Fix locale_t under macOS 10.10

`xlocale.h` is not available on Linux, so we can't just universally
include it.

`HAVE_XLOCALE_H` was already being tested/set in the CMake script as a
possible requirement for `wcstod_l` support, this just adds it to
`config_cmake_h.in` and uses it in `wutil.h` to gate the include.
This commit is contained in:
Mahmoud Al-Qudsi 2019-01-10 19:51:12 -06:00 committed by Fabian Homborg
parent 8737b654bf
commit 55526947d2
2 changed files with 7 additions and 0 deletions

View File

@ -153,6 +153,9 @@
/* The size of wchar_t in bits. */
#define WCHAR_T_BITS ${WCHAR_T_BITS}
/* Define if xlocale.h is required for locale_t or wide character support */
#cmakedefine HAVE_XLOCALE_H 1
/* Enable large inode numbers on Mac OS X 10.5. */
#ifndef _DARWIN_USE_64_BIT_INODE
# define _DARWIN_USE_64_BIT_INODE 1

View File

@ -10,6 +10,10 @@
#include <locale.h>
#include <string>
#ifdef HAVE_XLOCALE_H
#include <xlocale.h>
#endif
#include "common.h"
#include "maybe.h"