Commit Graph

37 Commits

Author SHA1 Message Date
Eric Haszlakiewicz
2fd95844c3 Issue #396: check for toolchain compatibilty with _REENTRANT before adding it to CFLAGS. 2018-03-04 22:32:45 -05:00
Eric Haszlakiewicz
0631c37c7f Update the master branch to version 0.13.99 2017-12-09 14:59:48 -05:00
Jason King
e3fabe9a44 Add long long 64-bit check 2017-09-08 01:46:06 +00:00
Eric Haszlakiewicz
2d1da5ab13 Add a --enable-threading configure option, and only use the (slower) __sync_add_and_fetch()/__sync_sub_and_fetch() function when it is specified. 2017-09-03 23:37:12 -04:00
Eric Haszlakiewicz
8777c9477a Use AC_CONFIG_MACRO_DIRS to specify path to the ax macros instead of passing -I to autoreconf in autogen.sh. 2017-09-03 22:35:58 -04:00
Eric Haszlakiewicz
5b11e9adff Explicitly check for GCC's atomic functions instead of depending on the __GNUC__ define.
Add a comment mentioning the limitation even though the _ref_count value is hanled atomically.
2017-09-02 14:48:17 -04:00
Eric Haszlakiewicz
fcad0ec015 PR #336: since we can't use function overriding (due to problems with it on
OSX) always include the _json_c_strerror function but only enable it with a flag
 during tests.
2017-07-15 07:12:44 -07:00
Alexandru Ardelean
fb72160caf build: make strerror() override-able
If we want to override `strerror()` in libjson-c
to make tests consistent across platforms, we
need to do it build-wide as configure/build
option.

Apple linkers make it really hard to override functions
at link-time, and this seems to be locked down on travis-ci.org
[ for security reasons I assume ].
While I got it to work locally, it did not work
when running on travis.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-13 10:27:24 +03:00
Alexandru Ardelean
85f57859fd configure.ac: check for uselocale function only on Linux platforms
On Apple this seems to fail the `test_locale` test,
which would imply that the `uselocale` function
does not behave as expected.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-13 09:33:42 +03:00
Eric Haszlakiewicz
a14ada5730 Remove a spurious comma in configure.ac 2017-07-09 16:00:32 -07:00
Björn Esser
cec97ebc6f Replace obsolete AM_PROG_LIBTOOL 2017-07-04 12:54:46 +02:00
Eric Haszlakiewicz
1a94c70336 Add a json_c_set_serialization_double_format() function to set the *library-wide* format for how doubles are written to a serialized JSON output. 2017-06-18 18:12:07 +00:00
Eric Haszlakiewicz
8157784483 Issue #295: also check if size_t is the size of long long, to help support 64-bit Windows platforms. 2017-01-07 22:55:31 -05:00
Eric Haszlakiewicz
a443b9f7e7 Issue#292: bump the required version of configure listed in configure.ac so a more useful error message is generated, rather than failing later because the extra macros from ./autoconf-archive/m4/ didn't get loaded. 2016-12-11 19:18:33 -08:00
Eric Haszlakiewicz
9688f343a5 Issue #246: Include xlocale.h too, to get locale_t defined, since not all OSes include that in locale.h 2016-08-02 22:25:05 -04:00
Eric Haszlakiewicz
4091b9c87e Issue #195: use uselocale() instead of setlocale() in json_tokener to behave better in threaded environments. 2016-07-30 21:34:58 -04:00
Eric Haszlakiewicz
595891729e Issue #236: Add -Wcast-qual and fix casts to retain constness.
To better distinguish between entry->k and entry->v being const within linkhash, but non-const outside, add lh_entry_v() and lh_entry_k() accessors.
Make lh_entry->k const.
2016-06-11 18:19:39 +00:00
Emmanuele Bassi
28c1ca1240 Use stdint.h to check for size_t size
If we use json_inttypes.h we are going to fail when builddir != srcdir,
and since JSON_C_HAVE_INTTYPES_H is defined after the configure script
has run, including json_inttypes.h would be the equivalent on including
stdint.h anyway.

This fixes the build of json-c in the GNOME Continuous builder.
2016-05-23 10:20:48 +01:00
Eric Haszlakiewicz
996be85843 Fix a few places that needed adjustment for the size_t changes, including updating the range checks to use a calculated SIZE_T_MAX. 2016-05-23 02:10:58 +00:00
Eric Haszlakiewicz
e3fb74942a Merge pull request #216 from Jehan/master
configure: check realloc with AC_CHECK_FUNCS() to fix cross-compilation.
2016-04-30 14:45:16 -04:00
Sevan Janiyan
7150b7f28d Use a macro to indicate C99 to the compiler
The [AC_PROG_CC_C99 macro](https://www.gnu.org/software/autoconf/manual/autoconf-2.64/html_node/C-Compiler.html) sets the complier to the C99 standard if the compiler does not default to such behaviour (albeit gnu99). This is better than specifically hardcoding flags
2016-01-05 11:43:17 +00:00
Jehan
79c99aeb2b configure: check realloc with AC_CHECK_FUNCS() to fix cross-compilation.
AC_FUNC_REALLOC is messed up when cross-compiling, ending up in failed
build with "undefined reference to `rpl_realloc'" error.
AC_CHECK_FUNCS will work both with native and cross builds.
2016-01-01 18:46:02 +01:00
Eric Haszlakiewicz
80c1f69b9e Use AX_APPEND_COMPILE_FLAGS() to check the various compile flags, such as -Wall, to ensure the compile supports. 2015-10-23 02:16:40 +00:00
Eric Haszlakiewicz
10d50aadf2 Remove the AC_FUNC_MALLOC check, since we don't depend on the malloc(0) behavior it checks for, and we don't provide a rpl_malloc() implementation anyway. 2015-10-22 02:57:13 +00:00
Jacob Alexander
e8a302017f Syntax error
- ./configure would fail due to bad code generation
2015-06-02 14:34:51 -07:00
Eric Haszlakiewicz
e1eb298de1 Merge pull request #182 from tpetazzoni/libm-fix
Link against libm when needed
2015-05-08 21:19:48 -04:00
Thomas Petazzoni
93582ad85e Link against libm when needed
In certain C libraries (e.g uClibc), isnan() and related functions are
implemented in libm, so json-c needs to link against it. This commit
therefore adds an AC_TRY_LINK() test to check whether a program
calling isnan() can be properly linked with no special flags. If not,
we assume linking against libm is needed.

The json-c.pc.in file is also adjusted so that in the case of static
linking against json-c, -lm is also used.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
2015-05-01 13:01:17 +02:00
Yegor Yefremov
36b0169ed6 Enable silent build by default 2015-04-25 22:11:44 +02:00
Eric Haszlakiewicz
515ba0dfb7 Bump versions up to 0.12.99 since a 0.12 release was just created. 2014-04-10 22:44:13 -04:00
Michael Clark
64e36901a0 Patch to address the following issues:
* CVE-2013-6371: hash collision denial of service
* CVE-2013-6370: buffer overflow if size_t is larger than int
2014-04-09 13:48:21 +08:00
Eric Haszlakiewicz
9f26d96f09 Fix warnings from autoconf about "...no AC_LANG_SOURCE call detected..." by adding that call within the AC_LINK_IFELSE call. 2014-03-22 19:15:01 -04:00
Eric Haszlakiewicz
05da316b9c Issue #103: allow Infinity and -Infinity to be parsed. 2014-03-22 17:28:40 -04:00
Eric Haszlakiewicz
0eedf3802f Issue#102 - add support for parsing "NaN". 2014-03-09 16:41:33 -04:00
Eric Haszlakiewicz
e6f1322b5e Issue#114: check for the presence of isnan and isinf, and provide compat macros on MSCV where _isnan and _finite exist instead. 2014-03-02 12:16:37 -05:00
Eric Haszlakiewicz
4c086dfff7 Merge commit '89535bb' 2014-02-11 23:57:24 -05:00
Eric Haszlakiewicz
c8e0497d47 Merge branch 'master' of https://github.com/ebassi/json-c into ebassi-master
Conflicts:
	Makefile.am
2014-02-11 23:05:54 -05:00
Eric Haszlakiewicz
a2c078fc6e Issue#105: Rename configure.in to configure.ac 2014-02-11 22:55:52 -05:00