diff options
Diffstat (limited to 'system/include/libcxx/support/win32')
-rw-r--r-- | system/include/libcxx/support/win32/limits_win32.h | 12 | ||||
-rw-r--r-- | system/include/libcxx/support/win32/locale_win32.h | 30 | ||||
-rw-r--r-- | system/include/libcxx/support/win32/math_win32.h | 2 | ||||
-rw-r--r-- | system/include/libcxx/support/win32/support.h | 7 |
4 files changed, 29 insertions, 22 deletions
diff --git a/system/include/libcxx/support/win32/limits_win32.h b/system/include/libcxx/support/win32/limits_win32.h index 52229c4d..406cd302 100644 --- a/system/include/libcxx/support/win32/limits_win32.h +++ b/system/include/libcxx/support/win32/limits_win32.h @@ -12,16 +12,15 @@ #define _LIBCPP_SUPPORT_WIN32_LIMITS_WIN32_H #if !defined(_LIBCPP_MSVCRT) -#error "This header complements Microsoft's C Runtime library, and should not be included otherwise." +#error "This header complements the Microsoft C Runtime library, and should not be included otherwise." #else -#ifndef NOMINMAX -#define NOMINMAX -#endif -#include <windows.h> // ymath.h works correctly - +#include <limits.h> // CHAR_BIT #include <float.h> // limit constants +#if ! defined(__clang__) +#define __CHAR_BIT__ CHAR_BIT + #define __FLT_MANT_DIG__ FLT_MANT_DIG #define __FLT_DIG__ FLT_DIG #define __FLT_RADIX__ FLT_RADIX @@ -73,6 +72,7 @@ #define __builtin_nans(__dummy) _Snan._Double #define __builtin_nansf(__dummy) _FSnan._Float #define __builtin_nansl(__dummy) _LSnan._Long_double +#endif // ! defined(__clang__) #endif // _LIBCPP_MSVCRT diff --git a/system/include/libcxx/support/win32/locale_win32.h b/system/include/libcxx/support/win32/locale_win32.h index 019586c0..e768af50 100644 --- a/system/include/libcxx/support/win32/locale_win32.h +++ b/system/include/libcxx/support/win32/locale_win32.h @@ -15,6 +15,7 @@ extern "C" unsigned short __declspec(dllimport) _ctype[]; #include "support/win32/support.h" +#include <stdio.h> #include <memory> #include <xlocinfo.h> // _locale_t #define locale_t _locale_t @@ -35,23 +36,23 @@ extern "C" unsigned short __declspec(dllimport) _ctype[]; locale_t newlocale( int mask, const char * locale, locale_t base ); locale_t uselocale( locale_t newloc ); lconv *localeconv_l( locale_t loc ); -size_t mbrlen_l( const char *__restrict__ s, size_t n, - mbstate_t *__restrict__ ps, locale_t loc); -size_t mbsrtowcs_l( wchar_t *__restrict__ dst, const char **__restrict__ src, - size_t len, mbstate_t *__restrict__ ps, locale_t loc ); -size_t wcrtomb_l( char *__restrict__ s, wchar_t wc, mbstate_t *__restrict__ ps, +size_t mbrlen_l( const char *__restrict s, size_t n, + mbstate_t *__restrict ps, locale_t loc); +size_t mbsrtowcs_l( wchar_t *__restrict dst, const char **__restrict src, + size_t len, mbstate_t *__restrict ps, locale_t loc ); +size_t wcrtomb_l( char *__restrict s, wchar_t wc, mbstate_t *__restrict ps, locale_t loc); -size_t mbrtowc_l( wchar_t *__restrict__ pwc, const char *__restrict__ s, - size_t n, mbstate_t *__restrict__ ps, locale_t loc); -size_t mbsnrtowcs_l( wchar_t *__restrict__ dst, const char **__restrict__ src, - size_t nms, size_t len, mbstate_t *__restrict__ ps, locale_t loc); -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); +size_t mbrtowc_l( wchar_t *__restrict pwc, const char *__restrict s, + size_t n, mbstate_t *__restrict ps, locale_t loc); +size_t mbsnrtowcs_l( wchar_t *__restrict dst, const char **__restrict src, + size_t nms, size_t len, mbstate_t *__restrict ps, locale_t loc); +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 ); typedef _VSTD::remove_pointer<locale_t>::type __locale_struct; typedef _VSTD::unique_ptr<__locale_struct, decltype(&uselocale)> __locale_raii; -_LIBCPP_ALWAYS_INLINE inline +inline _LIBCPP_ALWAYS_INLINE decltype(MB_CUR_MAX) MB_CUR_MAX_L( locale_t __l ) { __locale_raii __current( uselocale(__l), uselocale ); @@ -59,7 +60,6 @@ decltype(MB_CUR_MAX) MB_CUR_MAX_L( locale_t __l ) } // the *_l functions are prefixed on Windows, only available for msvcr80+, VS2005+ -#include <stdio.h> #define mbtowc_l _mbtowc_l #define strtoll_l _strtoi64_l #define strtoull_l _strtoui64_l @@ -120,10 +120,10 @@ inline int iswblank_l( wint_t c, locale_t /*loc*/ ) return ( c == L' ' || c == L'\t' ); } -#ifdef _MSC_VER +#if defined(_LIBCPP_MSVCRT) inline int isblank( int c, locale_t /*loc*/ ) { return ( c == ' ' || c == '\t' ); } inline int iswblank( wint_t c, locale_t /*loc*/ ) { return ( c == L' ' || c == L'\t' ); } -#endif // _MSC_VER +#endif // _LIBCPP_MSVCRT #endif // _LIBCPP_SUPPORT_WIN32_LOCALE_WIN32_H diff --git a/system/include/libcxx/support/win32/math_win32.h b/system/include/libcxx/support/win32/math_win32.h index 22400c0d..c62c54e3 100644 --- a/system/include/libcxx/support/win32/math_win32.h +++ b/system/include/libcxx/support/win32/math_win32.h @@ -16,7 +16,9 @@ #else #include <math.h> +#include <float.h> // _FPCLASS_PN etc. +// Necessary? typedef float float_t; typedef double double_t; diff --git a/system/include/libcxx/support/win32/support.h b/system/include/libcxx/support/win32/support.h index 17abb915..b953ab77 100644 --- a/system/include/libcxx/support/win32/support.h +++ b/system/include/libcxx/support/win32/support.h @@ -15,11 +15,16 @@ Functions and constants used in libc++ that are missing from the Windows C library. */ -#include <cwchar> // mbstate_t +#include <wchar.h> // mbstate_t #include <cstdarg> // va_ macros #define swprintf _snwprintf #define vswprintf _vsnwprintf +#ifndef NOMINMAX +#define NOMINMAX +#endif +#include <Windows.h> + extern "C" { int vasprintf( char **sptr, const char *__restrict fmt, va_list ap ); |