Browse Source

Issue #246: Include xlocale.h too, to get locale_t defined, since not all OSes include that in locale.h

tags/json-c-0.13-20171207
Eric Haszlakiewicz 9 years ago
parent
commit
9688f343a5
3 changed files with 7 additions and 1 deletions
  1. +1
    -1
      configure.ac
  2. +3
    -0
      json_tokener.c
  3. +3
    -0
      tests/test_locale.c

+ 1
- 1
configure.ac View File

@@ -34,7 +34,7 @@ AC_PROG_CC_C99
AC_CONFIG_HEADER(config.h) AC_CONFIG_HEADER(config.h)
AC_CONFIG_HEADER(json_config.h) AC_CONFIG_HEADER(json_config.h)
AC_HEADER_STDC 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])]) 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. # Checks for typedefs, structures, and compiler characteristics.


+ 3
- 0
json_tokener.c View File

@@ -35,6 +35,9 @@
#ifdef HAVE_LOCALE_H #ifdef HAVE_LOCALE_H
#include <locale.h> #include <locale.h>
#endif /* HAVE_LOCALE_H */ #endif /* HAVE_LOCALE_H */
#ifdef HAVE_XLOCALE_H
#include <xlocale.h>
#endif


#define jt_hexdigit(x) (((x) <= '9') ? (x) - '0' : ((x) & 7) + 9) #define jt_hexdigit(x) (((x) <= '9') ? (x) - '0' : ((x) & 7) + 9)




+ 3
- 0
tests/test_locale.c View File

@@ -11,6 +11,9 @@
#ifdef HAVE_LOCALE_H #ifdef HAVE_LOCALE_H
#include <locale.h> #include <locale.h>
#endif /* HAVE_LOCALE_H */ #endif /* HAVE_LOCALE_H */
#ifdef HAVE_XLOCALE_H
#include <xlocale.h>
#endif


int main(int argc, char **argv) int main(int argc, char **argv)
{ {


Loading…
Cancel
Save