include xlocale.h if available (because OSX)

ref https://github.com/ocaml/ocaml/pull/1682#issuecomment-377524854
master
ygrek 2018-05-26 19:56:38 -07:00 committed by Gabriel Scherer
parent 6f823bdd5b
commit 1739e4ee13
6 changed files with 26 additions and 7 deletions

View File

@ -31,6 +31,10 @@
#include <stddef.h>
#if defined(HAS_LOCALE_H) || defined(HAS_XLOCALE_H)
#define HAS_LOCALE
#endif
#ifdef HAS_STDINT_H
#include <stdint.h>
#endif

View File

@ -39,7 +39,14 @@
#include "caml/stacks.h"
#if defined(HAS_LOCALE) || defined(__MINGW32__)
#if defined(HAS_LOCALE_H) || defined(__MINGW32__)
#include <locale.h>
#endif
#if defined(HAS_XLOCALE_H)
#include <xlocale.h>
#endif
#if defined(_MSC_VER)
#ifndef locale_t
@ -53,7 +60,7 @@
#endif
#endif
#endif
#endif /* defined(HAS_LOCALE) */
#ifdef _MSC_VER
#include <float.h>

View File

@ -30,7 +30,7 @@
#define HAS_MKTIME
#define HAS_PUTENV
#ifndef __MINGW32__
#define HAS_LOCALE
#define HAS_LOCALE_H
#define HAS_STRTOD_L
#endif
#define HAS_BROKEN_PRINTF

View File

@ -185,9 +185,14 @@
/* Define HAS_PUTENV if you have putenv(). */
#define HAS_LOCALE
#define HAS_LOCALE_H
/* Define HAS_LOCALE if you have the include file <locale.h> and the
/* Define HAS_LOCALE_H if you have the include file <locale.h> and the
uselocale() function. */
#define HAS_XLOCALE_H
/* Define HAS_XLOCALE_H if you have the include file <xlocale.h> and the
uselocale() function. */
#define HAS_STRTOD_L

7
configure vendored
View File

@ -1485,7 +1485,12 @@ fi
if sh ./hasgot -i locale.h && sh ./hasgot newlocale freelocale uselocale; then
inf "newlocale() and <locale.h> found."
echo "#define HAS_LOCALE" >> s.h
echo "#define HAS_LOCALE_H" >> s.h
fi
if sh ./hasgot -i xlocale.h && sh ./hasgot newlocale freelocale uselocale; then
inf "newlocale() and <xlocale.h> found."
echo "#define HAS_XLOCALE_H" >> s.h
fi
if sh ./hasgot strtod_l; then

View File

@ -5,5 +5,3 @@ C_FILES=stubs
include $(BASEDIR)/makefiles/Makefile.one
include $(BASEDIR)/makefiles/Makefile.common
NATIVECODE_ONLY=true