summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMateusz Loskot <mateusz@loskot.net>2012-06-19 20:15:44 +0100
committerEric Haszlakiewicz <erh+git@nimenees.com>2012-12-09 15:53:21 -0600
commit5c2a69a8b8f863d057067b69e2658ef480eb1987 (patch)
tree5cfe652cf3c5a72f5e5039d438fc004dc1b0b342
parent4392b22e805599dfd20a5920ec2fd24a85f95af0 (diff)
downloadjson-c-0.10.tar.gz
Added a bunch of missing HAVE_* defines tested with ./configure script to fix compilation on Linux with GCC 4.7.1. The issue likely caused by my previous commits related to Visual C++ port of the code.json-c-0.10
-rw-r--r--config.h.in9
-rw-r--r--configure.in2
-rw-r--r--tests/test_printbuf.c2
3 files changed, 11 insertions, 2 deletions
diff --git a/config.h.in b/config.h.in
index 04f5dc5..2dad0d9 100644
--- a/config.h.in
+++ b/config.h.in
@@ -29,6 +29,9 @@
and to 0 otherwise. */
#undef HAVE_REALLOC
+/* Define to 1 if you have the `snprintf' function. */
+#undef HAVE_SNPRINTF
+
/* Define to 1 if you have the <stdarg.h> header file. */
#undef HAVE_STDARG_H
@@ -38,6 +41,12 @@
/* Define to 1 if you have the <stdlib.h> header file. */
#undef HAVE_STDLIB_H
+/* Define to 1 if you have the `strcasecmp' function. */
+#undef HAVE_STRCASECMP
+
+/* Define to 1 if you have the `strdup' function. */
+#undef HAVE_STRDUP
+
/* Define to 1 if you have the `strerror' function. */
#undef HAVE_STRERROR
diff --git a/configure.in b/configure.in
index b2c3cbe..bcb9027 100644
--- a/configure.in
+++ b/configure.in
@@ -27,7 +27,7 @@ AC_FUNC_VPRINTF
AC_FUNC_MEMCMP
AC_FUNC_MALLOC
AC_FUNC_REALLOC
-AC_CHECK_FUNCS(strndup strerror vsnprintf vasprintf open vsyslog strncasecmp)
+AC_CHECK_FUNCS(strcasecmp strdup strndup strerror snprintf vsnprintf vasprintf open vsyslog strncasecmp)
AM_PROG_LIBTOOL
diff --git a/tests/test_printbuf.c b/tests/test_printbuf.c
index 3676b54..ee3f80d 100644
--- a/tests/test_printbuf.c
+++ b/tests/test_printbuf.c
@@ -124,7 +124,7 @@ static void test_sprintbuf(int before_resize)
memset(data, 'X', before_resize + 1 + 1);
data[before_resize + 1] = '\0';
sprintbuf(pb, "%s", data);
- printf("sprintbuf to just after resize(%d+1): %d, [%s], strlen(buf)=%d\n", before_resize, printbuf_length(pb), pb->buf, strlen(pb->buf));
+ printf("sprintbuf to just after resize(%d+1): %d, [%s], strlen(buf)=%d\n", before_resize, printbuf_length(pb), pb->buf, (int)strlen(pb->buf));
printbuf_reset(pb);
sprintbuf(pb, "plain");