From 48c5cf183fa7cab608168fdec2406a1ca3cb2c11 Mon Sep 17 00:00:00 2001 From: Mark Pulford Date: Fri, 7 Oct 2011 22:51:31 +1030 Subject: Rename MISSING_ISINF to USE_INTERNAL_ISINF --- Makefile | 4 ++-- README | 2 +- lua-cjson-1.0.3-1.rockspec | 3 +++ lua_cjson.c | 4 ++-- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/Makefile b/Makefile index 5731440..5857aee 100644 --- a/Makefile +++ b/Makefile @@ -19,9 +19,9 @@ LUA_LIB_DIR ?= $(PREFIX)/lib/lua/$(LUA_VERSION) CFLAGS ?= -g -O3 -Wall -pedantic override CFLAGS += -fpic -I$(LUA_INCLUDE_DIR) -DVERSION=\"$(CJSON_VERSION)\" -## Conditional work arounds +## Optional work arounds # Handle Solaris platforms that are missing isinf(). -#override CFLAGS += -DMISSING_ISINF +#override CFLAGS += -DUSE_INTERNAL_ISINF # Handle locales that use comma as a decimal separator on locale aware # platforms. Requires POSIX-1.2008 support. override CFLAGS += -DUSE_POSIX_LOCALE diff --git a/README b/README index 473bf83..e8c3abe 100644 --- a/README +++ b/README @@ -55,7 +55,7 @@ build and install the module: # cp cjson.so [your_module_directory] Note: Some Solaris platforms are missing isinf(). You can work around - this bug by adding -DMISSING_ISINF to CFLAGS in the Makefile. + this bug by adding -DUSE_INTERNAL_ISINF to CFLAGS in the Makefile. 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 = { modules = { cjson = { sources = { "lua_cjson.c", "strbuf.c" }, +-- Optional workarounds: +-- USE_INTERNAL_ISINF: Provide internal isinf() implementation. Required +-- on some Solaris platforms. defines = { "VERSION=\"1.0.3\"" } } }, 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 @@ #define LOCALE_RESTORE(x) do { } while(0) #endif -#ifdef MISSING_ISINF -/* Some Solaris platforms are missing isinf(). Define here. */ +/* Some Solaris platforms are missing isinf(). */ +#if defined(USE_INTERNAL_ISINF) || defined(MISSING_ISINF) #define isinf(x) (!isnan(x) && isnan((x) - (x))) #endif -- cgit v1.2.3-55-g6feb