From 4f6a148fae0b154cff368071af8d4140c3df134c Mon Sep 17 00:00:00 2001 From: Matt Stancliff Date: Wed, 17 Dec 2014 20:01:48 -0500 Subject: [PATCH] Add isinf() if isinf() doesn't exist Fixes a build problem on Solaris. --- lua_cmsgpack.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lua_cmsgpack.c b/lua_cmsgpack.c index e13f053..6581f3d 100644 --- a/lua_cmsgpack.c +++ b/lua_cmsgpack.c @@ -18,6 +18,11 @@ #define LUACMSGPACK_MAX_NESTING 16 /* Max tables nesting. */ #endif +/* Workaround for Solaris platforms missing isinf() */ +#if !defined(isinf) && (defined(USE_INTERNAL_ISINF) || defined(MISSING_ISINF)) +#define isinf(x) (!isnan(x) && isnan((x) - (x))) +#endif + /* Check if float or double can be an integer without loss of precision */ #define IS_INT_TYPE_EQUIVALENT(x, T) (!isinf(x) && (T)(x) == (x))