Issue #463: fix newlocale() call to use LC_NUMERIC_MASK instead of LC_NUMERIC, and remove incorrect comment.
The second call to newlocale() with LC_TIME accidentally made things
work because LC_TIME == LC_NUMERIC_MASK on some platforms.
Add an explicit cast to double to squash a -Wimplicit-int-float-conversion warning.
Though we will no longer be comparing exactly against INT64_MAX, this is ok
because any value of that magnitude stored in a double will *also* have been
rounded up, so the comparison will work appropriately.
Jehan [Sat, 26 Jan 2019 11:30:40 +0000 (12:30 +0100)]
Installation directories empty with CMake in pkg-config.
CMake was not properly substituting the installation dir variables (they
ended up all empty), so the pkg-config results were also wrongs. For
instance cflags was: -I -I/json-c
Even though json-c was found at configure time, this obviously broke the
build of any application using it.
Ramiro Polla [Sat, 24 Nov 2018 02:36:51 +0000 (03:36 +0100)]
json_object_private: save 8 bytes in struct json_object in 64-bit architectures
- there is no need for _ref_count to be uint_fast32_t (the compiler
might decide to use a 64-bit int). make it uint32_t instead.
- reorder the 32-bit integer fields (o_type and _ref_count) so that
there is no wasted 4-byte gap after each of them.
Darjan Krijan [Wed, 21 Nov 2018 21:41:13 +0000 (22:41 +0100)]
Added a test for the space after \n issue with flags=JSON_C_TO_STRING_SPACED|JSON_C_TO_STRING_PRETTY|(JSON_C_TO_STRING_PRETTY_TAB) used in json_object_array_to_json_string
Darjan Krijan [Tue, 20 Nov 2018 21:21:27 +0000 (22:21 +0100)]
Fixed misalignment in JSON string due to space after \n being printed when choosing JSON_C_TO_STRING_SPACED together with JSON_C_TO_STRING_PRETTY in json_object_array_to_json_string
Jose Bollo [Wed, 25 Jul 2018 13:45:01 +0000 (15:45 +0200)]
Improve pkgconfig setting
This changes allows to use #include <json-c/json.h>
instead of just #include <json.h>
This is normally possible but in some tricky case
this usage is broken without this change.
Here is the case that I encountered. I had to
compile json-c fresh version for some investigations
on newer versions. Then I installed it on my local
environment using option --prefix. After that I
had 2 versions:
- the system wide version in usual locations
/usr/lib and /usr/include
- mine in my HOME directory
Then, as I'm used to include <json-c/json.h>, the
included iheder's version was the system wide one
whereas the linked lib was mine.
Unmanned Player [Mon, 23 Jul 2018 22:06:13 +0000 (08:06 +1000)]
The real CMake support
This patch provides a CMakeLists.txt file to build JSON-C library without relying on auto-tools support. This makes the build a bit more portable and cleaner.
It can detect headers and symbols and generate config.h header file based on those detections. It cannot yet handle ctest(1) as the testing itself depends on comparing the output against files. Testing would need some creative abuse of CMake :) This will be provided a few patches later and may possibly involve refactoring test cases.
The patch has been tested on GCC 4.8.5 (Linux), GCC 7.2.0 (MinGW) and Microsoft Visual C++ 16.0 (2010?) locally. Also, compiles correctly on Travis CI and AppVeyor without errors.
Keith Holman [Thu, 7 Jun 2018 17:19:27 +0000 (13:19 -0400)]
install json_object_iterator.h header file
When building the project using cmake then installing it. The
definitions in `json_object_iterator.h` are required but not installed
by the cmake install rule. This patch adds the `json_object_iterator.h`
file to the list of files to install.
Signed-off-by: Keith Holman <keith.holman@windriver.com>
Liang, Gao [Mon, 21 May 2018 08:28:06 +0000 (16:28 +0800)]
Resolve windows name conflict
1. The windows dll will output the lib and dll, and rename the static
lib will have conflict on windows.
2. Delete rename code to dismiss the conflict.
Issue #407: fix incorrect casts in calls to ctype functions (isdigit and isspace) so we don't crash when asserts are enabled on certain platforms and characters > 128 are parsed.
Bump the major version of the .so library generated up to 4.0 to avoid conflicts because some downstream packagers of json-c had already done their own bump to ".so.3" for a much older 0.12 release.