diff options
author | Mark Pulford <mark@kyne.com.au> | 2011-10-07 22:51:31 +1030 |
---|---|---|
committer | Mark Pulford <mark@kyne.com.au> | 2011-10-07 22:51:31 +1030 |
commit | 48c5cf183fa7cab608168fdec2406a1ca3cb2c11 (patch) | |
tree | 76b385d490badeb00cf6ced3b59843ef94f20c34 | |
parent | 0f3ab84a261292d16f684551e67f2f007199936a (diff) | |
download | lua-cjson-48c5cf183fa7cab608168fdec2406a1ca3cb2c11.tar.gz lua-cjson-48c5cf183fa7cab608168fdec2406a1ca3cb2c11.tar.bz2 lua-cjson-48c5cf183fa7cab608168fdec2406a1ca3cb2c11.zip |
Rename MISSING_ISINF to USE_INTERNAL_ISINF
-rw-r--r-- | Makefile | 4 | ||||
-rw-r--r-- | README | 2 | ||||
-rw-r--r-- | lua-cjson-1.0.3-1.rockspec | 3 | ||||
-rw-r--r-- | lua_cjson.c | 4 |
4 files changed, 8 insertions, 5 deletions
@@ -19,9 +19,9 @@ LUA_LIB_DIR ?= $(PREFIX)/lib/lua/$(LUA_VERSION) | |||
19 | CFLAGS ?= -g -O3 -Wall -pedantic | 19 | CFLAGS ?= -g -O3 -Wall -pedantic |
20 | override CFLAGS += -fpic -I$(LUA_INCLUDE_DIR) -DVERSION=\"$(CJSON_VERSION)\" | 20 | override CFLAGS += -fpic -I$(LUA_INCLUDE_DIR) -DVERSION=\"$(CJSON_VERSION)\" |
21 | 21 | ||
22 | ## Conditional work arounds | 22 | ## Optional work arounds |
23 | # Handle Solaris platforms that are missing isinf(). | 23 | # Handle Solaris platforms that are missing isinf(). |
24 | #override CFLAGS += -DMISSING_ISINF | 24 | #override CFLAGS += -DUSE_INTERNAL_ISINF |
25 | # Handle locales that use comma as a decimal separator on locale aware | 25 | # Handle locales that use comma as a decimal separator on locale aware |
26 | # platforms. Requires POSIX-1.2008 support. | 26 | # platforms. Requires POSIX-1.2008 support. |
27 | override CFLAGS += -DUSE_POSIX_LOCALE | 27 | override CFLAGS += -DUSE_POSIX_LOCALE |
@@ -55,7 +55,7 @@ build and install the module: | |||
55 | # cp cjson.so [your_module_directory] | 55 | # cp cjson.so [your_module_directory] |
56 | 56 | ||
57 | Note: Some Solaris platforms are missing isinf(). You can work around | 57 | Note: Some Solaris platforms are missing isinf(). You can work around |
58 | this bug by adding -DMISSING_ISINF to CFLAGS in the Makefile. | 58 | this bug by adding -DUSE_INTERNAL_ISINF to CFLAGS in the Makefile. |
59 | 59 | ||
60 | 60 | ||
61 | RPM | 61 | RPM |
diff --git a/lua-cjson-1.0.3-1.rockspec b/lua-cjson-1.0.3-1.rockspec index 1550ae9..3f8e981 100644 --- a/lua-cjson-1.0.3-1.rockspec +++ b/lua-cjson-1.0.3-1.rockspec | |||
@@ -24,6 +24,9 @@ build = { | |||
24 | modules = { | 24 | modules = { |
25 | cjson = { | 25 | cjson = { |
26 | sources = { "lua_cjson.c", "strbuf.c" }, | 26 | sources = { "lua_cjson.c", "strbuf.c" }, |
27 | -- Optional workarounds: | ||
28 | -- USE_INTERNAL_ISINF: Provide internal isinf() implementation. Required | ||
29 | -- on some Solaris platforms. | ||
27 | defines = { "VERSION=\"1.0.3\"" } | 30 | defines = { "VERSION=\"1.0.3\"" } |
28 | } | 31 | } |
29 | }, | 32 | }, |
diff --git a/lua_cjson.c b/lua_cjson.c index 151fa39..ad3818d 100644 --- a/lua_cjson.c +++ b/lua_cjson.c | |||
@@ -66,8 +66,8 @@ | |||
66 | #define LOCALE_RESTORE(x) do { } while(0) | 66 | #define LOCALE_RESTORE(x) do { } while(0) |
67 | #endif | 67 | #endif |
68 | 68 | ||
69 | #ifdef MISSING_ISINF | 69 | /* Some Solaris platforms are missing isinf(). */ |
70 | /* Some Solaris platforms are missing isinf(). Define here. */ | 70 | #if defined(USE_INTERNAL_ISINF) || defined(MISSING_ISINF) |
71 | #define isinf(x) (!isnan(x) && isnan((x) - (x))) | 71 | #define isinf(x) (!isnan(x) && isnan((x) - (x))) |
72 | #endif | 72 | #endif |
73 | 73 | ||