]> granicus.if.org Git - json-c/commitdiff
Include json_inttypes.h in json_object.h since we use types like int32_t in the API...
authorEric Haszlakiewicz <erh+git@nimenees.com>
Thu, 16 Feb 2012 02:44:54 +0000 (20:44 -0600)
committerEric Haszlakiewicz <erh+git@nimenees.com>
Thu, 16 Feb 2012 02:47:11 +0000 (20:47 -0600)
As part of this create a public json_config.h with a custom define to
decide whether to include inttypes.h to avoid conflicting with other
projects config.h header.

Makefile.am
config.h.in
configure.in
json_config.h.in [new file with mode: 0644]
json_inttypes.h
json_object.h

index 0e8b303ee7bcaba59c7fabc89b242680a8dbd697..e31da7730c9ca2bd480ceeca95137e7c8dc14bcc 100644 (file)
@@ -13,6 +13,7 @@ libjsoninclude_HEADERS = \
        bits.h \
        debug.h \
        json.h \
+       json_config.h \
        json_inttypes.h \
        json_object.h \
        json_object_private.h \
@@ -21,6 +22,11 @@ libjsoninclude_HEADERS = \
        linkhash.h \
        printbuf.h
 
+#libjsonx_includedir = $(libdir)/json-c-@VERSION@
+#
+#libjsonx_include_HEADERS = \
+#      json_config.h
+
 libjson_la_LDFLAGS = -version-info 1:0:1 -no-undefined
 
 libjson_la_SOURCES = \
index 83ab7973a8c22891a9f950e062aed77d62dcd544..04f5dc5f8ec338073bc6dc48b4da5c67b91818f9 100644 (file)
 /* Define to 1 if you have the `vsyslog' function. */
 #undef HAVE_VSYSLOG
 
+/* Public define for json_inttypes.h */
+#undef JSON_C_HAVE_INTTYPES_H
+
+/* Define to the sub-directory in which libtool stores uninstalled libraries.
+   */
+#undef LT_OBJDIR
+
 /* Name of package */
 #undef PACKAGE
 
 /* Define to the one symbol short name of this package. */
 #undef PACKAGE_TARNAME
 
+/* Define to the home page for this package. */
+#undef PACKAGE_URL
+
 /* Define to the version of this package. */
 #undef PACKAGE_VERSION
 
 /* Define to rpl_realloc if the replacement function should be used. */
 #undef realloc
 
-/* Define to `unsigned' if <sys/types.h> does not define. */
+/* Define to `unsigned int' if <sys/types.h> does not define. */
 #undef size_t
index 7e2bbc8b0ef4558bfac8069b9f83498b10ed8ca4..7334319e179efb050437386dbb5e33a7d4d3cdfa 100644 (file)
@@ -11,8 +11,10 @@ AM_INIT_AUTOMAKE(AC_PACKAGE_NAME, AC_PACKAGE_VERSION)
 
 # Checks for header files.
 AM_CONFIG_HEADER(config.h)
+AM_CONFIG_HEADER(json_config.h)
 AC_HEADER_STDC
 AC_CHECK_HEADERS(fcntl.h limits.h strings.h syslog.h unistd.h [sys/param.h] stdarg.h)
+AC_CHECK_HEADER(inttypes.h,[AC_DEFINE([JSON_C_HAVE_INTTYPES_H],[1],[Public define for json_inttypes.h])])
 
 # Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
diff --git a/json_config.h.in b/json_config.h.in
new file mode 100644 (file)
index 0000000..7888e02
--- /dev/null
@@ -0,0 +1,3 @@
+
+/* Define to 1 if you have the <inttypes.h> header file. */
+#undef JSON_C_HAVE_INTTYPES_H
index 1f3e4d2992848285a18aff058df04460c3726b8b..b71bb098816a635f683143fa5a21b899325e3dac 100644 (file)
@@ -2,6 +2,8 @@
 #ifndef _json_inttypes_h_
 #define _json_inttypes_h_
 
+#include "json_config.h"
+
 #if defined(_MSC_VER) && _MSC_VER < 1600
 
 /* Anything less than Visual Studio C++ 10 is missing stdint.h and inttypes.h */
@@ -14,7 +16,7 @@ typedef __int64 int64_t;
 
 #else
 
-#ifdef HAVE_INTTYPES_H
+#ifdef JSON_C_HAVE_INTTYPES_H
 #include <inttypes.h>
 #endif
 /* inttypes.h includes stdint.h */
index d56d12c4c38d805f55f4dca544ceae20e5378438..e4f4c45cd4c2b6984ec9b83e74fbde4118a083ed 100644 (file)
@@ -12,6 +12,8 @@
 #ifndef _json_object_h_
 #define _json_object_h_
 
+#include "json_inttypes.h"
+
 #ifdef __cplusplus
 extern "C" {
 #endif