summaryrefslogtreecommitdiffstats
path: root/libcxx/include
diff options
context:
space:
mode:
Diffstat (limited to 'libcxx/include')
-rw-r--r--libcxx/include/__config4
-rw-r--r--libcxx/include/__locale4
-rw-r--r--libcxx/include/locale9
-rw-r--r--libcxx/include/stdio.h3
-rw-r--r--libcxx/include/support/win32/locale_win32.h15
-rw-r--r--libcxx/include/wchar.h2
6 files changed, 16 insertions, 21 deletions
diff --git a/libcxx/include/__config b/libcxx/include/__config
index ec007907c73..212a2d53136 100644
--- a/libcxx/include/__config
+++ b/libcxx/include/__config
@@ -220,10 +220,12 @@
#endif // __NetBSD__
#if defined(_WIN32)
-# define _LIBCPP_WIN32API 1
+# define _LIBCPP_WIN32API
# define _LIBCPP_LITTLE_ENDIAN 1
# define _LIBCPP_BIG_ENDIAN 0
# define _LIBCPP_SHORT_WCHAR 1
+// Both MinGW and native MSVC provide a "MSVC"-like enviroment
+# define _LIBCPP_MSVCRT_LIKE
// If mingw not explicitly detected, assume using MS C runtime only.
# ifndef __MINGW32__
# define _LIBCPP_MSVCRT // Using Microsoft's C Runtime library
diff --git a/libcxx/include/__locale b/libcxx/include/__locale
index cf3ba23b909..766842294ca 100644
--- a/libcxx/include/__locale
+++ b/libcxx/include/__locale
@@ -19,7 +19,7 @@
#include <cstdint>
#include <cctype>
#include <locale.h>
-#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
+#if defined(_LIBCPP_MSVCRT_LIKE)
# include <support/win32/locale_win32.h>
#elif defined(_AIX)
# include <support/ibm/xlocale.h>
@@ -367,7 +367,7 @@ public:
static const mask punct = _ISpunct;
static const mask xdigit = _ISxdigit;
static const mask blank = _ISblank;
-#elif defined(_LIBCPP_MSVCRT)
+#elif defined(_LIBCPP_MSVCRT_LIKE)
typedef unsigned short mask;
static const mask space = _SPACE;
static const mask print = _BLANK|_PUNCT|_ALPHA|_DIGIT;
diff --git a/libcxx/include/locale b/libcxx/include/locale
index bdedbeae246..6aaa22ccaa1 100644
--- a/libcxx/include/locale
+++ b/libcxx/include/locale
@@ -192,14 +192,7 @@ template <class charT> class messages_byname;
#endif
#include <cstdlib>
#include <ctime>
-#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)
-#include <support/win32/locale_win32.h>
-#elif defined(_NEWLIB_VERSION)
-// FIXME: replace all the uses of _NEWLIB_VERSION with __NEWLIB__ preceded by an
-// include of <sys/cdefs.h> once https://sourceware.org/ml/newlib-cvs/2014-q3/msg00038.html
-// has had a chance to bake for a bit
-#include <support/newlib/xlocale.h>
-#endif
+#include <cstdio>
#ifdef _LIBCPP_HAS_CATOPEN
#include <nl_types.h>
#endif
diff --git a/libcxx/include/stdio.h b/libcxx/include/stdio.h
index dc534970f9d..f1241764016 100644
--- a/libcxx/include/stdio.h
+++ b/libcxx/include/stdio.h
@@ -110,10 +110,9 @@ void perror(const char* s);
#ifdef __cplusplus
// snprintf
-#if defined(_LIBCPP_MSVCRT)
+#if defined(_LIBCPP_MSVCRT_LIKE)
extern "C" {
int vasprintf(char **sptr, const char *__restrict fmt, va_list ap);
-int asprintf(char **sptr, const char *__restrict fmt, ...);
}
#endif
diff --git a/libcxx/include/support/win32/locale_win32.h b/libcxx/include/support/win32/locale_win32.h
index 7a6c44ca900..b2b3ac4c799 100644
--- a/libcxx/include/support/win32/locale_win32.h
+++ b/libcxx/include/support/win32/locale_win32.h
@@ -52,20 +52,21 @@ size_t wcsnrtombs_l( char *__restrict dst, const wchar_t **__restrict src,
size_t nwc, size_t len, mbstate_t *__restrict ps, locale_t loc);
wint_t btowc_l( int c, locale_t loc );
int wctob_l( wint_t c, locale_t loc );
-inline _LIBCPP_ALWAYS_INLINE
-decltype(MB_CUR_MAX) MB_CUR_MAX_L( locale_t __l )
-{
- return ___mb_cur_max_l_func(__l);
-}
+
+decltype(MB_CUR_MAX) MB_CUR_MAX_L( locale_t __l );
// the *_l functions are prefixed on Windows, only available for msvcr80+, VS2005+
#define mbtowc_l _mbtowc_l
#define strtoll_l _strtoi64_l
#define strtoull_l _strtoui64_l
-#define strtof_l _strtof_l
#define strtod_l _strtod_l
+#if defined(_LIBCPP_MSVCRT)
+#define strtof_l _strtof_l
#define strtold_l _strtold_l
-
+#else
+float strtof_l(const char*, char**, locale_t);
+long double strtold_l(const char*, char**, locale_t);
+#endif
inline _LIBCPP_INLINE_VISIBILITY
int
islower_l(int c, _locale_t loc)
diff --git a/libcxx/include/wchar.h b/libcxx/include/wchar.h
index 25a318faff2..a5666e193a5 100644
--- a/libcxx/include/wchar.h
+++ b/libcxx/include/wchar.h
@@ -166,7 +166,7 @@ inline _LIBCPP_INLINE_VISIBILITY _LIBCPP_PREFERRED_OVERLOAD
}
#endif
-#if defined(__cplusplus) && defined(_LIBCPP_MSVCRT)
+#if defined(__cplusplus) && defined(_LIBCPP_MSVCRT_LIKE)
extern "C" {
size_t mbsnrtowcs(wchar_t *__restrict dst, const char **__restrict src,
size_t nmc, size_t len, mbstate_t *__restrict ps);
OpenPOWER on IntegriCloud