summaryrefslogtreecommitdiff
path: root/deps/lua
diff options
context:
space:
mode:
authorantirez <antirez@gmail.com>2014-12-05 10:51:09 +0100
committerantirez <antirez@gmail.com>2014-12-05 10:51:25 +0100
commitff25d1896d3befe184aa1adebf5d5e961f5d4b15 (patch)
treeae5201c0be642dc5b2fc7a80d5b3abfa78744999 /deps/lua
parentc3846becae5528e2987865ec1a5ef2cdeca3dadd (diff)
downloadredis-ff25d1896d3befe184aa1adebf5d5e961f5d4b15.tar.gz
Simplify lua_cmsgpack macro and fix build on old Linux distros.
Thanks to @badboy for the help in checking the build after the fix.
Diffstat (limited to 'deps/lua')
-rw-r--r--deps/lua/src/lua_cmsgpack.c8
1 files changed, 1 insertions, 7 deletions
diff --git a/deps/lua/src/lua_cmsgpack.c b/deps/lua/src/lua_cmsgpack.c
index 6aa04e2f1..4ccf07f6d 100644
--- a/deps/lua/src/lua_cmsgpack.c
+++ b/deps/lua/src/lua_cmsgpack.c
@@ -18,14 +18,8 @@
#define LUACMSGPACK_MAX_NESTING 16 /* Max tables nesting. */
#endif
-#if (_XOPEN_SOURCE >= 600 || _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L)
- #define IS_FINITE(x) isfinite(x)
-#else
- #define IS_FINITE(x) ((x) == (x) && (x) + 1 > (x))
-#endif
-
/* Check if float or double can be an integer without loss of precision */
-#define IS_INT_TYPE_EQUIVALENT(x, T) (IS_FINITE(x) && (T)(x) == (x))
+#define IS_INT_TYPE_EQUIVALENT(x, T) (!isinf(x) && (T)(x) == (x))
#define IS_INT64_EQUIVALENT(x) IS_INT_TYPE_EQUIVALENT(x, int64_t)
#define IS_INT_EQUIVALENT(x) IS_INT_TYPE_EQUIVALENT(x, int)