From: Eric Haszlakiewicz Date: Wed, 3 Aug 2016 02:25:05 +0000 (-0400) Subject: Issue #246: Include xlocale.h too, to get locale_t defined, since not all OSes includ... X-Git-Tag: json-c-0.13-20171207~141 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9688f343a54ca5f2f7cf5988e3cd05fc62ab2b21;p=thirdparty%2Fjson-c.git Issue #246: Include xlocale.h too, to get locale_t defined, since not all OSes include that in locale.h --- diff --git a/configure.ac b/configure.ac index a08fa168..161ff007 100644 --- a/configure.ac +++ b/configure.ac @@ -34,7 +34,7 @@ AC_PROG_CC_C99 AC_CONFIG_HEADER(config.h) AC_CONFIG_HEADER(json_config.h) AC_HEADER_STDC -AC_CHECK_HEADERS(fcntl.h limits.h strings.h syslog.h unistd.h [sys/cdefs.h] [sys/param.h] stdarg.h locale.h endian.h) +AC_CHECK_HEADERS(fcntl.h limits.h strings.h syslog.h unistd.h [sys/cdefs.h] [sys/param.h] stdarg.h locale.h xlocale.h endian.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. diff --git a/json_tokener.c b/json_tokener.c index 0c4007c4..fdee1b3b 100644 --- a/json_tokener.c +++ b/json_tokener.c @@ -35,6 +35,9 @@ #ifdef HAVE_LOCALE_H #include #endif /* HAVE_LOCALE_H */ +#ifdef HAVE_XLOCALE_H +#include +#endif #define jt_hexdigit(x) (((x) <= '9') ? (x) - '0' : ((x) & 7) + 9) diff --git a/tests/test_locale.c b/tests/test_locale.c index f7f481c6..a3e319da 100644 --- a/tests/test_locale.c +++ b/tests/test_locale.c @@ -11,6 +11,9 @@ #ifdef HAVE_LOCALE_H #include #endif /* HAVE_LOCALE_H */ +#ifdef HAVE_XLOCALE_H +#include +#endif int main(int argc, char **argv) {