Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mpx/lua-cjson.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMark Pulford <mark@kyne.com.au>2011-12-29 16:33:58 +0400
committerMark Pulford <mark@kyne.com.au>2012-03-04 12:24:34 +0400
commitca42b9a996f9046ba3876ad8a81cda1d935b39cf (patch)
tree229cc0e408e28abc882778c68496c87af0d781ba /CMakeLists.txt
parent8eecc878e0560461ef42bd3cd8d6dfe33cf148e8 (diff)
Use internal dtoa/strtod for double conversion
The internal Lua CJSON dtoa/strtod routines have locale support disabled. This avoids problems under locales with comma decimal separators. Build changes: - CMake: Check for big endian architectures - Makefile: Provide option to build with dtoa.c Modifications to dtoa.c: - Include locale dtoa_config.h configuration - Rename Infinity/NaN to inf/nan to match common C libraries - Rename strtod() -> internal_strtod() to prevent conflict with libc function Modifications to g_fmt.c: - Return output string length (instead of original buffer pointer) - Provide precision as an argument to g_fmt() - Silence compilations warnings from vendor source - while(a = b) - Unused label "done:" - Only swap to scientific notation when once the number of decimal digits required exceeds the precision available. This matches standard printf format %g. - Display a "0" in front of numbers < 1.
Diffstat (limited to 'CMakeLists.txt')
-rw-r--r--CMakeLists.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 8d8a420..ffc718b 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -11,6 +11,12 @@ set(CMAKE_BUILD_TYPE Release)
find_package(Lua51 REQUIRED)
include_directories(${LUA_INCLUDE_DIR})
+include(TestBigEndian)
+TEST_BIG_ENDIAN(BIG_ENDIAN)
+if(HAVE_BIG_ENDIAN)
+ add_definitions(-DIEEE_BIG_ENDIAN)
+endif()
+
# Handle platforms missing isinf() macro (Eg, some Solaris systems).
include(CheckSymbolExists)
CHECK_SYMBOL_EXISTS(isinf math.h HAVE_ISINF)