aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorPetri Lehtinen <petri@digip.org>2011-10-02 21:27:53 +0300
committerPetri Lehtinen <petri@digip.org>2011-10-02 21:31:17 +0300
commitd7ddbf366197605642f725cce6165dfb179a114e (patch)
tree56da549f28dbe1631a2539374c53b0c85293e2c1 /configure.ac
parentb6d0191e51003dfdfd2dcb36a52baafcdbf4246c (diff)
downloadjansson-d7ddbf366197605642f725cce6165dfb179a114e.zip
jansson-d7ddbf366197605642f725cce6165dfb179a114e.tar.gz
jansson-d7ddbf366197605642f725cce6165dfb179a114e.tar.bz2
Make real number encoding and decoding work under all locales
The decimal point '.' is changed to locale's decimal point before/after JSON conversion to make C standard library's locale-specific string conversion functions work correctly. All the tests now call setlocale(LC_ALL, "") on startup to use the locale set in the environment. Fixes GH-32.
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac7
1 files changed, 7 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index 64e22d7..c138937 100644
--- a/configure.ac
+++ b/configure.ac
@@ -14,6 +14,7 @@ AM_CONDITIONAL([GCC], [test x$GCC = xyes])
# Checks for libraries.
# Checks for header files.
+AC_CHECK_HEADERS([locale.h])
# Checks for typedefs, structures, and compiler characteristics.
AC_TYPE_INT32_T
@@ -34,6 +35,12 @@ esac
AC_SUBST([json_inline])
# Checks for library functions.
+AC_CHECK_FUNCS([setlocale localeconv])
+case "$ac_cv_header_locale_h$ac_cv_func_localeconv" in
+ yesyes) json_have_localeconv=1;;
+ *) json_have_localeconv=0;;
+esac
+AC_SUBST([json_have_localeconv])
AC_CONFIG_FILES([
jansson.pc