mirror of
https://github.com/fluencelabs/redis
synced 2025-03-19 09:00:51 +00:00
Simplify lua_cmsgpack macro and fix build on old Linux distros.
Thanks to @badboy for the help in checking the build after the fix.
This commit is contained in:
parent
c3846becae
commit
ff25d1896d
8
deps/lua/src/lua_cmsgpack.c
vendored
8
deps/lua/src/lua_cmsgpack.c
vendored
@ -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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user