提交 0c211a19 编写于 作者: A antirez

Simplify lua_cmsgpack macro and fix build on old Linux distros.

Thanks to @badboy for the help in checking the build after the fix.
上级 d6ada4d1
...@@ -18,14 +18,8 @@ ...@@ -18,14 +18,8 @@
#define LUACMSGPACK_MAX_NESTING 16 /* Max tables nesting. */ #define LUACMSGPACK_MAX_NESTING 16 /* Max tables nesting. */
#endif #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 */ /* 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_INT64_EQUIVALENT(x) IS_INT_TYPE_EQUIVALENT(x, int64_t)
#define IS_INT_EQUIVALENT(x) IS_INT_TYPE_EQUIVALENT(x, int) #define IS_INT_EQUIVALENT(x) IS_INT_TYPE_EQUIVALENT(x, int)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册