summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorMark Pulford <mark@kyne.com.au>2011-10-05 23:30:27 +1030
committerMark Pulford <mark@kyne.com.au>2011-10-05 23:30:27 +1030
commit0f3ab84a261292d16f684551e67f2f007199936a (patch)
tree5ece4652a08b968232b417f5cf4ceaf234f2be2f /Makefile
parent03fa2b508aee4cdf2eac41d53834412ac757feef (diff)
downloadlua-cjson-0f3ab84a261292d16f684551e67f2f007199936a.tar.gz
lua-cjson-0f3ab84a261292d16f684551e67f2f007199936a.tar.bz2
lua-cjson-0f3ab84a261292d16f684551e67f2f007199936a.zip
Support locales which use comma decimal separators
Some locales (cs_CZ, de_DE,..) use a comma as their decimal separator. This causes CJSON to generate incorrect JSON (Eg, [10,1]), and fail when parsing some valid JSON (Eg, [10,"test"]). Added USE_POSIX_LOCALE #define which harnesses the thread-safe POSIX.1-2008 locale support (newlocale(), uselocale(), freelocale()) to temporarily use the POSIX locale during JSON conversion. Some older POSIX operating systems with xlocale.h (MacOSX) are also supported.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile10
1 files changed, 7 insertions, 3 deletions
diff --git a/Makefile b/Makefile
index d34ff6d..5731440 100644
--- a/Makefile
+++ b/Makefile
@@ -15,13 +15,17 @@ LDFLAGS += -shared
15LUA_INCLUDE_DIR ?= $(PREFIX)/include 15LUA_INCLUDE_DIR ?= $(PREFIX)/include
16LUA_LIB_DIR ?= $(PREFIX)/lib/lua/$(LUA_VERSION) 16LUA_LIB_DIR ?= $(PREFIX)/lib/lua/$(LUA_VERSION)
17 17
18# Some versions of Solaris are missing isinf(). Add -DMISSING_ISINF to
19# CFLAGS to work around this bug.
20
21#CFLAGS ?= -g -Wall -pedantic -fno-inline 18#CFLAGS ?= -g -Wall -pedantic -fno-inline
22CFLAGS ?= -g -O3 -Wall -pedantic 19CFLAGS ?= -g -O3 -Wall -pedantic
23override CFLAGS += -fpic -I$(LUA_INCLUDE_DIR) -DVERSION=\"$(CJSON_VERSION)\" 20override CFLAGS += -fpic -I$(LUA_INCLUDE_DIR) -DVERSION=\"$(CJSON_VERSION)\"
24 21
22## Conditional work arounds
23# Handle Solaris platforms that are missing isinf().
24#override CFLAGS += -DMISSING_ISINF
25# Handle locales that use comma as a decimal separator on locale aware
26# platforms. Requires POSIX-1.2008 support.
27override CFLAGS += -DUSE_POSIX_LOCALE
28
25INSTALL ?= install 29INSTALL ?= install
26 30
27.PHONY: all clean install package 31.PHONY: all clean install package