Commit Graph

633 Commits

Author SHA1 Message Date
Eric Haszlakiewicz
e1561ed1df Remove the Visual Studio project files as they were out of date, and should now be generated by using cmake. 2017-09-06 23:50:03 -04:00
Eric Haszlakiewicz
7e608c5728 Issue #359: Use consistent spacing in CMakeLists.txt 2017-09-06 23:42:38 -04:00
Eric Haszlakiewicz
32f503f738 Issue #359: Don't duplicate lh_get_hash, just omit the "inline" for VS2010. 2017-09-06 23:42:30 -04:00
Eric Haszlakiewicz
d58693b0f0 Merge pull request #359 from Haffon/api-0.12
update CMakeLists.txt for compile with visual studio at least 2010
2017-09-06 23:20:36 -04:00
Haffon
837a249f01 set JSON_C_HEADERS full file name 2017-09-07 10:39:14 +08:00
Haffon
e9f9f14f22 if compile with vs2015, enable the "static inline" declare. 2017-09-07 10:28:26 +08:00
Haffon
b301f4ea01 rollback api to 0.12 2017-09-07 10:02:21 +08:00
Haffon
86a3a6475f Merge pull request #2 from json-c/master
merge upstream
2017-09-07 09:33:07 +08:00
Eric Haszlakiewicz
548d000891 Undo a bit of 2d1da5ab: handle per-thread formats for double serialization, even if --enable-threading wasn't specified. 2017-09-05 01:56:42 -04:00
Eric Haszlakiewicz
b2afca4560 Issue #173: since some sscanf implementations return 0 for non-zero inputs, directly check for "0" in the input. 2017-09-05 01:53:13 -04: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
ab0d4dbc69 Merge branch 'pull-211'
This is EmielBruijntes' "Atomic updates for the refcount"
2017-09-02 13:54:15 -04:00
Eric Haszlakiewicz
95dff31951 Issue #351: don't redefine SIZE_T_MAX if it's already defined. 2017-08-30 23:35:56 -04:00
Eric Haszlakiewicz
447d67d5f3 Issue #349: none of automake's clean targets are suite for really cleaning up everything, so add a local "really-clean" target that does so. 2017-08-30 23:17:24 -04:00
Haffon
95e174e2fb Merge pull request #1 from json-c/master
want to merge the original repository
2017-08-30 00:02:59 +08:00
Eric Haszlakiewicz
81f6edbfd5 PR#331: for Visual Studio, use a snprintf/vsnprintf wrapper that ensures the string is terminated. 2017-08-25 01:15:39 -04:00
Haffon
3141c3976b 1.make it can been compiled with Visual Studio 2010
2.replace json_object_get/put API with json_object_retain/release, as they operate the reference counter, and confused with array_list_get/put_idx.
3.replace array_list_get/put_idx API with array_list_get/insert to make them more clear to use.
2017-08-22 13:53:47 +08:00
Eric Haszlakiewicz
256ebcd827 Merge pull request #346 from schwehr/get_int
Clamp double to int32 when narrowing in json_object_get_int.
2017-08-21 20:50:58 -05:00
Eric Haszlakiewicz
474376f30a Merge pull request #345 from MrAnno/fix-make-dist
Fix make dist and make distcheck
2017-08-21 20:50:20 -05:00
Eric Haszlakiewicz
2f1fe55f66 Merge pull request #344 from fastogt/master
Fix Mingw build
2017-08-21 20:39:11 -05:00
Kurt Schwehr
ef7b08ce7f Clamp double to int32 when narrowing in json_object_get_int.
Avoids undefined behavior.  Found by autofuzz.
2017-08-08 07:54:38 -07:00
László Várady
e0e34f0a13 Fix 'make distcheck'
Signed-off-by: László Várady <laszlo.varady@balabit.com>
2017-08-04 12:31:11 +02:00
László Várady
db8dbbf371 Fix 'make dist'
EXTRA_DIST copies the listed directories/files from the _source_ directory
into the distribution.

Since the doc directory does not exist after running autogen + configure
+ make dist, the distribution tarball generation fails.

Note that the dist-hook rule below operates on 'distdir', not on the source
directory where EXTRA_DIST expects the existence of the doc folder.

In summary, even if I removed 'doc' from EXTRA_DIST, the dist tarball will
always contain the documentation (due to the dist-hook rule).

Signed-off-by: László Várady <laszlo.varady@balabit.com>
2017-08-04 12:31:06 +02:00
topilski
0a99e7a5c1 Fix Mingw build 2017-07-30 07:37:17 +03:00
topilski
65884f4d9e Fix parsing doubles for mingw 2017-07-30 07:30:05 +03:00
Eric Haszlakiewicz
af87944585 PR #336: fix to previous change, be sure to include string.h when we're using the real strerror. 2017-07-27 20:17:25 -07:00
Eric Haszlakiewicz
36dbe2d74e PR #336: Fix typo in defining STRERROR_OVERRIDE_IMPL 2017-07-27 20:10:53 -07:00
Eric Haszlakiewicz
8d8a785bd2 Merge pull request #340 from commodo/fix-appveyor-build
strerror_override: add extern "C" and JSON_EXPORT specifiers for Visual C++ compilers
2017-07-27 23:09:12 -04:00
Alexandru Ardelean
d8fbfc7aa1 build,travis: drop -enable-strerror-override argument (no longer exists)
Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-19 15:22:36 +03:00
Alexandru Ardelean
ddce7c28e4 strerror_override: add extern "C" and JSON_EXPORT specifiers for Visual C++ compilers
Fixes build on AppVeyor.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-19 15:17:39 +03: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
Eric Haszlakiewicz
730ab7b019 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:07:28 -07:00
Eric Haszlakiewicz
40317f079e Allow USE_VALGRIND to be set to anything starting with 0, N or n to disable valgrind during tests. 2017-07-15 07:03:18 -07:00
Eric Haszlakiewicz
c0b7d762b2 Merge pull request #336 from commodo/fix-tests
tests: fix tests in travis-ci.org
2017-07-13 22:39:01 -04:00
Alexandru Ardelean
bc2e30453b build,travis: enable strerror override option in build
To get consistent output between Linux & OS X.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-13 10:27:33 +03: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
Alexandru Ardelean
7b9432d564 tests: fix leak in test_util_file ; found by cppcheck
Which now seems to fail the build.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-13 09:05:13 +03:00
Alexandru Ardelean
effab3f91a travis,tests: run cppcheck only if it exists
ugh... seems cppcheck is not packaged for OS X
And `set -e` exposes this.

And also `cppcheck` seems to exit with non-zero
exit codes by default [even if errs found].

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-13 09:05:13 +03:00
Alexandru Ardelean
9d47ae824c tests: compress test_utile_file with test_basic
More code compression/de-duplication.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-11 10:38:25 +03:00
Alexandru Ardelean
ba8625a701 tests: add set -e specifier to bail early on build run
Seems that test1 is failing, but travis is not catching it.
Likely, this is because the `cppcheck` returns success
and we need to bail on the `make check` step.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-11 10:38:25 +03:00
Eric Haszlakiewicz
dd8dcb8228 Merge pull request #335 from commodo/build_status_travis
README.md: show build status tag from travis-ci.org
2017-07-11 00:16:12 -04:00
Alexandru Ardelean
061afc7993 README.md: show build status tag from travis & appveyor.
Looks nice to see a `Build Passing` tag when you
scroll to the README.

Signed-off-by: Alexandru Ardelean <ardeleanalex@gmail.com>
2017-07-10 11:45:24 +03:00
Eric Haszlakiewicz
b64402ede2 Move a variable declaration to the start of the block to work better with older compilers. 2017-07-09 16:09:09 -07:00
Eric Haszlakiewicz
a14ada5730 Remove a spurious comma in configure.ac 2017-07-09 16:00:32 -07:00
Eric Haszlakiewicz
33db761551 Updated expected test1 output which should have been included in commit fd9b3b2. 2017-07-09 15:22:53 -07:00
Eric Haszlakiewicz
1d3e97f2ab Comment out the warning about racy random seed initialization in lh_char_hash(), if you're on a platform where it'll be triggered it just makes it a pain to build. 2017-07-09 15:13:02 -07:00
Eric Haszlakiewicz
f7a44ad101 Add extra casts to void * to squash some warning on certain systems (e.g. CentOS w/ gcc 4.1.2). 2017-07-09 15:08:21 -07:00