From 7fbc37fa4b731a74f639f4e46b8c395af0777d3d Mon Sep 17 00:00:00 2001 From: Sandu Liviu Catalin Date: Tue, 5 Jul 2016 23:08:32 +0300 Subject: [PATCH] Don't duplicate the configuration header files of the JSON library because they're the same across compiled platforms. --- config/mingw64/jansson_config.h | 68 ------------------- config/mingw64/jansson_private_config.h | 53 --------------- include/jansson.h | 2 +- {config/mingw32 => include}/jansson_config.h | 7 +- .../jansson_private_config.h | 2 +- 5 files changed, 7 insertions(+), 125 deletions(-) delete mode 100644 config/mingw64/jansson_config.h delete mode 100644 config/mingw64/jansson_private_config.h rename {config/mingw32 => include}/jansson_config.h (93%) rename {config/mingw32 => include}/jansson_private_config.h (97%) diff --git a/config/mingw64/jansson_config.h b/config/mingw64/jansson_config.h deleted file mode 100644 index 2cc22cf6..00000000 --- a/config/mingw64/jansson_config.h +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2010-2014 Petri Lehtinen - * - * Jansson is free software; you can redistribute it and/or modify - * it under the terms of the MIT license. See LICENSE for details. - * - * - * This file specifies a part of the site-specific configuration for - * Jansson, namely those things that affect the public API in - * jansson.h. - * - * The CMake system will generate the jansson_config.h file and - * copy it to the build and install directories. - */ - -#ifndef JANSSON_CONFIG_H -#define JANSSON_CONFIG_H - -/* Define this so that we can disable scattered automake configuration in source files */ -#ifndef JANSSON_USING_CMAKE -#define JANSSON_USING_CMAKE -#endif - -/* Note: when using cmake, JSON_INTEGER_IS_LONG_LONG is not defined nor used, - * as we will also check for __int64 etc types. - * (the definition was used in the automake system) */ - -/* Bring in the cmake-detected defines */ -#define HAVE_STDINT_H 1 -/* #undef HAVE_INTTYPES_H */ -#define HAVE_SYS_TYPES_H 1 - -/* Include our standard type header for the integer typedef */ - -#if defined(HAVE_STDINT_H) -# include -#elif defined(HAVE_INTTYPES_H) -# include -#elif defined(HAVE_SYS_TYPES_H) -# include -#endif - - -/* If your compiler supports the inline keyword in C, JSON_INLINE is - defined to `inline', otherwise empty. In C++, the inline is always - supported. */ -#ifdef __cplusplus -#define JSON_INLINE inline -#else -#define JSON_INLINE inline -#endif - - -#define json_int_t long long -#define json_strtoint strtoll -#define JSON_INTEGER_FORMAT "I64d" - - -/* If locale.h and localeconv() are available, define to 1, otherwise to 0. */ -#define JSON_HAVE_LOCALECONV 1 - - -/* Maximum recursion depth for parsing JSON input. - This limits the depth of e.g. array-within-array constructions. */ -#define JSON_PARSER_MAX_DEPTH 2048 - - -#endif diff --git a/config/mingw64/jansson_private_config.h b/config/mingw64/jansson_private_config.h deleted file mode 100644 index bb0c8cde..00000000 --- a/config/mingw64/jansson_private_config.h +++ /dev/null @@ -1,53 +0,0 @@ -/* #undef HAVE_ENDIAN_H */ -#define HAVE_FCNTL_H 1 -#define HAVE_SCHED_H 1 -#define HAVE_UNISTD_H 1 -#define HAVE_SYS_PARAM_H 1 -#define HAVE_SYS_STAT_H 1 -#define HAVE_SYS_TIME_H 1 -#define HAVE_SYS_TYPES_H 1 -#define HAVE_STDINT_H 1 - -#define HAVE_CLOSE 1 -#define HAVE_GETPID 1 -#define HAVE_GETTIMEOFDAY 1 -#define HAVE_OPEN 1 -#define HAVE_READ 1 -#define HAVE_SCHED_YIELD 1 - -#define HAVE_SYNC_BUILTINS 1 -#define HAVE_ATOMIC_BUILTINS 1 - -#define HAVE_LOCALE_H 1 -#define HAVE_SETLOCALE 1 - -#define HAVE_INT32_T 1 -#ifndef HAVE_INT32_T -# define int32_t int32_t -#endif - -#define HAVE_UINT32_T 1 -#ifndef HAVE_UINT32_T -# define uint32_t uint32_t -#endif - -#define HAVE_UINT16_T 1 -#ifndef HAVE_UINT16_T -# define uint16_t uint16_t -#endif - -#define HAVE_UINT8_T 1 -#ifndef HAVE_UINT8_T -# define uint8_t uint8_t -#endif - -#define HAVE_SSIZE_T 1 - -#ifndef HAVE_SSIZE_T -# define ssize_t -#endif - -#define USE_URANDOM 1 -#define USE_WINDOWS_CRYPTOAPI 1 - -#define INITIAL_HASHTABLE_ORDER 3 diff --git a/include/jansson.h b/include/jansson.h index ee607946..bfab1210 100644 --- a/include/jansson.h +++ b/include/jansson.h @@ -54,7 +54,7 @@ typedef struct json_t { #ifndef JANSSON_USING_CMAKE /* disabled if using cmake */ #if JSON_INTEGER_IS_LONG_LONG -#ifdef _WIN32 +#if defined(_WIN32) || defined(WIN32) #define JSON_INTEGER_FORMAT "I64d" #else #define JSON_INTEGER_FORMAT "lld" diff --git a/config/mingw32/jansson_config.h b/include/jansson_config.h similarity index 93% rename from config/mingw32/jansson_config.h rename to include/jansson_config.h index 2cc22cf6..b4c9aeb4 100644 --- a/config/mingw32/jansson_config.h +++ b/include/jansson_config.h @@ -53,8 +53,11 @@ #define json_int_t long long #define json_strtoint strtoll -#define JSON_INTEGER_FORMAT "I64d" - +#if defined(_WIN32) || defined(WIN32) + #define JSON_INTEGER_FORMAT "I64d" +#else + #define JSON_INTEGER_FORMAT "lld" +#endif /* If locale.h and localeconv() are available, define to 1, otherwise to 0. */ #define JSON_HAVE_LOCALECONV 1 diff --git a/config/mingw32/jansson_private_config.h b/include/jansson_private_config.h similarity index 97% rename from config/mingw32/jansson_private_config.h rename to include/jansson_private_config.h index bb0c8cde..e844800d 100644 --- a/config/mingw32/jansson_private_config.h +++ b/include/jansson_private_config.h @@ -1,4 +1,4 @@ -/* #undef HAVE_ENDIAN_H */ +#define HAVE_ENDIAN_H 1 #define HAVE_FCNTL_H 1 #define HAVE_SCHED_H 1 #define HAVE_UNISTD_H 1