aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt6
-rw-r--r--Makefile4
-rw-r--r--fpconv.h2
-rw-r--r--manual.txt2
4 files changed, 7 insertions, 7 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index c18381f..5de35db 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -7,7 +7,7 @@ project(lua-cjson C)
7cmake_minimum_required(VERSION 2.6) 7cmake_minimum_required(VERSION 2.6)
8 8
9option(ENABLE_CJSON_GLOBAL "Register cjson module table as a global variable - not recommended") 9option(ENABLE_CJSON_GLOBAL "Register cjson module table as a global variable - not recommended")
10option(USE_INTERNAL_DTOA "Use internal strtod() / dtoa code for performance") 10option(USE_INTERNAL_FPCONV "Use internal strtod() / g_fmt() code for performance")
11option(MULTIPLE_THREADS 11option(MULTIPLE_THREADS
12 "Build internal dtoa with support for multi-threaded applications - recommended" ON) 12 "Build internal dtoa with support for multi-threaded applications - recommended" ON)
13 13
@@ -24,12 +24,12 @@ if(ENABLE_CJSON_GLOBAL)
24 add_definitions(-DENABLE_CJSON_GLOBAL) 24 add_definitions(-DENABLE_CJSON_GLOBAL)
25endif() 25endif()
26 26
27if(NOT USE_INTERNAL_DTOA) 27if(NOT USE_INTERNAL_FPCONV)
28 # Use libc number conversion routines (strtod(), sprintf()) 28 # Use libc number conversion routines (strtod(), sprintf())
29 set(FPCONV_SOURCES fpconv.c) 29 set(FPCONV_SOURCES fpconv.c)
30else() 30else()
31 # Use internal number conversion routines 31 # Use internal number conversion routines
32 add_definitions(-DUSE_INTERNAL_DTOA) 32 add_definitions(-DUSE_INTERNAL_FPCONV)
33 set(FPCONV_SOURCES g_fmt.c dtoa.c) 33 set(FPCONV_SOURCES g_fmt.c dtoa.c)
34 34
35 include(TestBigEndian) 35 include(TestBigEndian)
diff --git a/Makefile b/Makefile
index de1c144..bf06d73 100644
--- a/Makefile
+++ b/Makefile
@@ -6,7 +6,7 @@
6## NaN, Infinity, hex. 6## NaN, Infinity, hex.
7## 7##
8## Optional built-in number conversion uses the following defines: 8## Optional built-in number conversion uses the following defines:
9## USE_INTERNAL_DTOA: Use builtin strtod/dtoa for numeric conversions. 9## USE_INTERNAL_FPCONV: Use builtin strtod/dtoa for numeric conversions.
10## IEEE_BIG_ENDIAN: Required on big endian architectures. 10## IEEE_BIG_ENDIAN: Required on big endian architectures.
11## MULTIPLE_THREADS: Must be set when Lua CJSON may be used in a 11## MULTIPLE_THREADS: Must be set when Lua CJSON may be used in a
12## multi-threaded application. Requries _pthreads_. 12## multi-threaded application. Requries _pthreads_.
@@ -54,7 +54,7 @@ LUA_BIN_DIR = $(PREFIX)/bin
54 54
55## Enable built in number conversion 55## Enable built in number conversion
56#FPCONV_OBJS = g_fmt.o dtoa.o 56#FPCONV_OBJS = g_fmt.o dtoa.o
57#CJSON_CFLAGS += -DUSE_INTERNAL_DTOA 57#CJSON_CFLAGS += -DUSE_INTERNAL_FPCONV
58 58
59## Compile built in number conversion for big endian architectures 59## Compile built in number conversion for big endian architectures
60#CJSON_CFLAGS += -DIEEE_BIG_ENDIAN 60#CJSON_CFLAGS += -DIEEE_BIG_ENDIAN
diff --git a/fpconv.h b/fpconv.h
index ac2f2c4..0124908 100644
--- a/fpconv.h
+++ b/fpconv.h
@@ -6,7 +6,7 @@
6 * -1.7976931348623e+308 */ 6 * -1.7976931348623e+308 */
7# define FPCONV_G_FMT_BUFSIZE 32 7# define FPCONV_G_FMT_BUFSIZE 32
8 8
9#ifdef USE_INTERNAL_DTOA 9#ifdef USE_INTERNAL_FPCONV
10static inline void fpconv_init() 10static inline void fpconv_init()
11{ 11{
12 /* Do nothing - not required */ 12 /* Do nothing - not required */
diff --git a/manual.txt b/manual.txt
index 8ca4778..eacd2c7 100644
--- a/manual.txt
+++ b/manual.txt
@@ -133,7 +133,7 @@ converting data number heavy data. However, this option reduces
133portability and is disabled by default. 133portability and is disabled by default.
134 134
135[horizontal] 135[horizontal]
136USE_INTERNAL_DTOA:: Enable internal number conversion routines. 136USE_INTERNAL_FPCONV:: Enable internal number conversion routines.
137IEEE_BIG_ENDIAN:: Must be set on big endian architectures. 137IEEE_BIG_ENDIAN:: Must be set on big endian architectures.
138MULTIPLE_THREADS:: Must be set when Lua CJSON may be used in a 138MULTIPLE_THREADS:: Must be set when Lua CJSON may be used in a
139 multi-threaded application. Requries _pthreads_. 139 multi-threaded application. Requries _pthreads_.