From 0f3ab84a261292d16f684551e67f2f007199936a Mon Sep 17 00:00:00 2001 From: Mark Pulford Date: Wed, 5 Oct 2011 23:30:27 +1030 Subject: 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. --- Makefile | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'Makefile') diff --git a/Makefile b/Makefile index d34ff6d..5731440 100644 --- a/Makefile +++ b/Makefile @@ -15,13 +15,17 @@ LDFLAGS += -shared LUA_INCLUDE_DIR ?= $(PREFIX)/include LUA_LIB_DIR ?= $(PREFIX)/lib/lua/$(LUA_VERSION) -# Some versions of Solaris are missing isinf(). Add -DMISSING_ISINF to -# CFLAGS to work around this bug. - #CFLAGS ?= -g -Wall -pedantic -fno-inline CFLAGS ?= -g -O3 -Wall -pedantic override CFLAGS += -fpic -I$(LUA_INCLUDE_DIR) -DVERSION=\"$(CJSON_VERSION)\" +## Conditional work arounds +# Handle Solaris platforms that are missing isinf(). +#override CFLAGS += -DMISSING_ISINF +# Handle locales that use comma as a decimal separator on locale aware +# platforms. Requires POSIX-1.2008 support. +override CFLAGS += -DUSE_POSIX_LOCALE + INSTALL ?= install .PHONY: all clean install package -- cgit v1.2.3-55-g6feb