Commit Graph

283 Commits

Author SHA1 Message Date
Petri Lehtinen
61cba2ae50 Merge branch '2.4' 2013-04-15 08:49:47 +03:00
Petri Lehtinen
867079c820 json_dump*(): Don't crash if json is NULL and JSON_ENCODE_ANY is set 2013-04-15 08:49:09 +03:00
Petri Lehtinen
6281d1c549 Merge pull request #108 from Zillode/1edff47af38a2335f88300ee6dc437118f5a20ff
Fixes redefined warnings ("_GNU_SOURCE")
2013-04-02 05:40:49 -07:00
Lode Hoste
1edff47af3 Do not define _GNU_SOURCE is already defined 2013-03-14 21:34:11 +01:00
Joakim Soderberg
650707fccc Moved *config.h.cmake to the cmake directory. 2013-03-07 18:38:47 +01:00
Joakim Soderberg
e40d52c550 Consolidated the CMake project.
- Moved everything to one CMakeLists.txt
- Added support for the json_process test suites (instead of just the API
  tests).
- Changed to use the modified json_process version that does away with the
  environment variables (originally written by DanielT).
- Had to exclude "test_memory_funcs" on MSVC, since void pointer
  arithmetics are not allowed as it is done in secure_malloc and
  secure_free.
- Had to add a check for "ssize_t". This is not available on Windows and
  maybe on some other platforms (used in test_pack.c)
- Result from running ctest (The failure seems unrelated to CMake, it's
  just that the expected result is in a different order):
99% tests passed, 1 tests failed out of 121

Total Test time (real) =   1.31 sec

The following tests FAILED:
         24 - valid__complex-array (Failed)
2013-03-07 16:11:07 +01:00
Paul Harris
3e03b07831 Add CMake build system.
Added multiple CMake-related files to project.
Supports building the library and the tests.
See CMakeLists.txt for notes on how it works.

I had to adjust 3 existing files in order to disable some configuration
that should be taken care of by cmake/automake anyway.

I also added jansson.def from a future jansson version,
to test cmake's support for .def files (which works fine).
2013-03-07 16:06:01 +01:00
Petri Lehtinen
b9967fdbcf Merge branch '2.4' 2013-02-04 09:52:31 +02:00
Petri Lehtinen
93a3c7f663 Enable gcc specific flags in tests correctly
... and fix issues found.
2013-02-04 09:49:58 +02:00
Petri Lehtinen
40c2e532b9 Merge branch '2.4' 2013-01-03 10:46:46 +02:00
Petri Lehtinen
02beb90db3 Make it possible to forward declare struct json_t
This allows e.g. to use json_t in a header file that doesn't include
jansson.h:

    struct json_t;
    typedef struct json_t json_t;

    json_t *foo(json_t *bar);
2013-01-03 10:45:38 +02:00
Petri Lehtinen
08c5ec8f01 Merge branch '2.4' 2012-12-28 14:11:59 +02:00
Petri Lehtinen
e9cb9dbf60 Fix // -> /* */ 2012-12-28 14:11:43 +02:00
Petri Lehtinen
b98be1f18d Merge branch '2.4' 2012-12-10 08:47:11 +02:00
Jacob Potter
872f847655 Change const pointer to array
Closes #95.
2012-12-10 08:47:00 +02:00
Jacob Potter
f86bb0377f Mark some constant data as const.
Issue #95.
2012-12-10 08:47:00 +02:00
Attie Grande
c82cea9d32 fixed l_isxdigit() macro
Closes #97.
2012-12-10 08:47:00 +02:00
Petri Lehtinen
67c002f7c9 Merge branch '2.4' 2012-12-04 21:23:33 +02:00
Petri Lehtinen
e0a7f81b39 Really fix the off-by-one error in json_array_remove()
It didn't affect only the last element but all of them. One item too
much was always moved.
2012-12-04 21:20:59 +02:00
Petri Lehtinen
7b35a18ac0 Merge branch '2.4' 2012-12-04 09:33:48 +02:00
Petri Lehtinen
54d59c743c Fix an off-by-one error in json_array_remove()
Uninitialized memory was read when the last item of a "full" array was
removed.
2012-12-04 09:32:45 +02:00
Petri Lehtinen
5804e9de9b Set master for 2.5 development mode 2012-09-23 13:41:40 +03:00
Petri Lehtinen
3279aacdee jansson 2.4 2012-09-23 12:52:41 +03:00
Petri Lehtinen
2158670177 Distribute win32 files 2012-09-23 12:52:40 +03:00
Petri Lehtinen
c3fc1d7382 Merge pull request #90 from luke-jr/patch-1
Add -no-undefined to LDFLAGS
2012-09-18 21:11:26 -07:00
Luke Dashjr
c922354076 Add -no-undefined to LDFLAGS
This tells libtool that jansson does not require any external symbols, and allows building it as a shared library (DLL) on Windows.
2012-09-15 08:45:29 +00:00
Petri Lehtinen
4118315afa Disallow NaN or Inf real values 2012-09-13 21:30:19 +03:00
Petri Lehtinen
ee13c667f1 Fix json_real_set() to return -1 on error 2012-09-13 08:46:56 +03:00
Petri Lehtinen
b6a1d8cfd4 Add json_boolean() macro
Mostly for symmetry reasons. Makes it easier e.g. to:

  int ok = 0;
  if(something)
      ok = 1;

  json_object_set_new(obj, "ok", json_boolean(ok));

Fixes #86.
2012-07-30 07:20:37 +03:00
Petri Lehtinen
37bc3bbf4b Tweak slash escaping 2012-06-29 13:25:02 +03:00
Petri Lehtinen
2d46ea069b Merge branch 'fix-slash' of git://github.com/jrbasso/jansson
Fixes #81.
2012-06-29 13:24:55 +03:00
Juan Basso
b217cd6689 Created flag to dump escaping slash 2012-06-28 22:04:36 -04:00
Juan Basso
a0c262d08b Escaping the slash when dump 2012-06-27 23:54:08 -04:00
Rogerz Zhang
a79f64e155 Fix build warnings under MinGW 2012-05-01 08:02:12 +08:00
Rogerz Zhang
7ca783c3bc Add vs2010 solution and project 2012-04-30 21:51:07 +08:00
Petri Lehtinen
ff0c05b8f1 Support building on Windows
Jansson now builds correctly with Visual C++ Express 2010.
2012-04-29 22:09:29 +03:00
Petri Lehtinen
abdb8d99d7 Merge branch '2.3'
Conflicts:
	configure.ac
	doc/conf.py
	src/jansson.h
2012-04-20 21:41:25 +03:00
Petri Lehtinen
ff6e6ee293 jansson 2.3.1 2012-04-20 21:35:00 +03:00
Petri Lehtinen
1581f26a7f Merge branch '2.3'
Closes #70.
2012-04-18 21:27:26 +03:00
Janne Kulmala
aabfd493d3 load: Change buffer_pos to be a size_t
buffer_pos should be type size_t, because it's used to store the
current position in the read buffer. Also, it never can be negative.
2012-04-18 21:21:17 +03:00
Janne Kulmala
bd72efbd80 load: Avoid unexpected behaviour in macro expansion
Macros can be dangerous if the inserted arguments are not properly
parenthesised. As macro expansion does a simple replacement, inserting
a certain expression can cause the evaluation order of the macro expression
to change.
2012-04-18 21:21:17 +03:00
Petri Lehtinen
e8fd3e3085 Document and tweak json_load_callback()
Change the return value of json_load_callback_t to size_t, as it's
feels more correct. The callback should return (size_t)-1 on failure.

Issue #57.
2012-03-26 21:53:21 +03:00
Rogerz Zhang
040bd7b0fa Add json_load_callback() 2012-03-22 14:52:57 +08:00
Petri Lehtinen
d286e7b753 Merge branch '2.3' 2012-03-20 20:56:00 +02:00
Petri Lehtinen
3c6e36ba2d Update copyright notices for 2012 2012-03-20 20:55:55 +02:00
Petri Lehtinen
9af64480e1 Merge branch '2.3' 2012-03-20 20:48:36 +02:00
Petri Lehtinen
4ae5736bd0 Make sure strtoll() is available when using long long 2012-03-20 20:47:57 +02:00
Petri Lehtinen
56039ed596 Merge branch '2.3' 2012-03-11 21:16:41 +02:00
Petri Lehtinen
02b915af54 Remove unused declarations 2012-03-11 21:12:52 +02:00
Petri Lehtinen
a894980258 Set master to 2.4 development mode 2012-01-30 20:59:32 +02:00