mirror of
https://github.com/json-c/json-c.git
synced 2026-03-27 08:59:07 +08:00
Fix some Windows compile issues, add JSON_EXPORT's, fix bogus character escapes, define __func__ and omit unistd.h if needed.
This commit is contained in:
@@ -20,7 +20,7 @@ static const char *input_json_str = "{ "
|
||||
"'foo': ['bar', 'baz'], "
|
||||
"'': 0, "
|
||||
"'a/b': 1, "
|
||||
"'c\%d': 2, "
|
||||
"'c%d': 2, "
|
||||
"'e^f': 3, "
|
||||
"'g|h': 4, "
|
||||
"'i\\\\j': 5, "
|
||||
@@ -238,7 +238,7 @@ static void test_example_set()
|
||||
assert(0 == json_pointer_set(&jo1, "/", json_object_new_int(9)));
|
||||
printf("PASSED - SET - / == 9\n");
|
||||
|
||||
jo2 = json_tokener_parse("{ 'foo': [ 'bar', 'cod' ], '': 9, 'a/b': 1, 'c\%d': 2, 'e^f': 3, 'g|h': 4, 'i\\\\j': 5, 'k\\\"l': 6, ' ': 7, 'm~n': 8, 'fud': { 'gaw': [ 0, 2, 3, 4 ] } }");
|
||||
jo2 = json_tokener_parse("{ 'foo': [ 'bar', 'cod' ], '': 9, 'a/b': 1, 'c%d': 2, 'e^f': 3, 'g|h': 4, 'i\\\\j': 5, 'k\\\"l': 6, ' ': 7, 'm~n': 8, 'fud': { 'gaw': [ 0, 2, 3, 4 ] } }");
|
||||
assert(json_object_equal(jo2, jo1));
|
||||
printf("PASSED - SET - Final JSON is: %s\n", json_object_get_string(jo1));
|
||||
json_object_put(jo2);
|
||||
|
||||
@@ -11,6 +11,11 @@
|
||||
static void test_basic_printbuf_memset(void);
|
||||
static void test_printbuf_memset_length(void);
|
||||
|
||||
#ifndef __func__
|
||||
/* VC++ compat */
|
||||
#define __func__ __FUNCTION__
|
||||
#endif
|
||||
|
||||
static void test_basic_printbuf_memset()
|
||||
{
|
||||
struct printbuf *pb;
|
||||
@@ -158,7 +163,7 @@ int main(int argc, char **argv)
|
||||
{
|
||||
int before_resize = 0;
|
||||
|
||||
mc_set_debug(1);
|
||||
MC_SET_DEBUG(1);
|
||||
|
||||
test_basic_printbuf_memset();
|
||||
printf("========================================\n");
|
||||
|
||||
@@ -6,7 +6,9 @@
|
||||
#include <string.h>
|
||||
#include <fcntl.h>
|
||||
#include <limits.h>
|
||||
#include <unistd.h>
|
||||
#if HAVE_UNISTD_H
|
||||
# include <unistd.h>
|
||||
#endif /* HAVE_UNISTD_H */
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user