diff options
author | Bruce Mitchener <bruce.mitchener@gmail.com> | 2013-08-08 15:29:07 +0700 |
---|---|---|
committer | Bruce Mitchener <bruce.mitchener@gmail.com> | 2013-08-09 09:53:12 +0700 |
commit | 6f894d481d19e05fbc10f3ce7d74d9180d1cbb64 (patch) | |
tree | 8260bbd04f17fbee780c654b35175e89c10129fa /system/include/libcxx/support/win32 | |
parent | 6c275bebb45d6aac7e4a024b825ab34971b178d2 (diff) |
Update libcxx to revision 187959, 2013-08-08.
Diffstat (limited to 'system/include/libcxx/support/win32')
-rw-r--r-- | system/include/libcxx/support/win32/limits_win32.h | 6 | ||||
-rw-r--r-- | system/include/libcxx/support/win32/locale_win32.h | 17 | ||||
-rw-r--r-- | system/include/libcxx/support/win32/math_win32.h | 6 | ||||
-rw-r--r-- | system/include/libcxx/support/win32/support.h | 21 |
4 files changed, 31 insertions, 19 deletions
diff --git a/system/include/libcxx/support/win32/limits_win32.h b/system/include/libcxx/support/win32/limits_win32.h index 671631df..52229c4d 100644 --- a/system/include/libcxx/support/win32/limits_win32.h +++ b/system/include/libcxx/support/win32/limits_win32.h @@ -11,8 +11,8 @@ #ifndef _LIBCPP_SUPPORT_WIN32_LIMITS_WIN32_H #define _LIBCPP_SUPPORT_WIN32_LIMITS_WIN32_H -#if !defined(_MSC_VER) -#error "This header is MSVC specific, Clang and GCC should not include it" +#if !defined(_LIBCPP_MSVCRT) +#error "This header complements Microsoft's C Runtime library, and should not be included otherwise." #else #ifndef NOMINMAX @@ -74,6 +74,6 @@ #define __builtin_nansf(__dummy) _FSnan._Float #define __builtin_nansl(__dummy) _LSnan._Long_double -#endif // _MSC_VER +#endif // _LIBCPP_MSVCRT #endif // _LIBCPP_SUPPORT_WIN32_LIMITS_WIN32_H diff --git a/system/include/libcxx/support/win32/locale_win32.h b/system/include/libcxx/support/win32/locale_win32.h index e035420f..019586c0 100644 --- a/system/include/libcxx/support/win32/locale_win32.h +++ b/system/include/libcxx/support/win32/locale_win32.h @@ -65,8 +65,21 @@ decltype(MB_CUR_MAX) MB_CUR_MAX_L( locale_t __l ) #define strtoull_l _strtoui64_l // FIXME: current msvcrt does not know about long double #define strtold_l _strtod_l -#define islower_l _islower_l -#define isupper_l _isupper_l + +inline _LIBCPP_INLINE_VISIBILITY +int +islower_l(int c, _locale_t loc) +{ + return _islower_l((int)c, loc); +} + +inline _LIBCPP_INLINE_VISIBILITY +int +isupper_l(int c, _locale_t loc) +{ + return _isupper_l((int)c, loc); +} + #define isdigit_l _isdigit_l #define isxdigit_l _isxdigit_l #define strcoll_l _strcoll_l diff --git a/system/include/libcxx/support/win32/math_win32.h b/system/include/libcxx/support/win32/math_win32.h index 41c50d62..22400c0d 100644 --- a/system/include/libcxx/support/win32/math_win32.h +++ b/system/include/libcxx/support/win32/math_win32.h @@ -11,8 +11,8 @@ #ifndef _LIBCPP_SUPPORT_WIN32_MATH_WIN32_H #define _LIBCPP_SUPPORT_WIN32_MATH_WIN32_H -#if !defined(_MSC_VER) -#error "This header is MSVC specific, Clang and GCC should not include it" +#if !defined(_LIBCPP_MSVCRT) +#error "This header complements Microsoft's C Runtime library, and should not be included otherwise." #else #include <math.h> @@ -108,6 +108,6 @@ _LIBCPP_ALWAYS_INLINE int fpclassify( double num ) return _fpclass(num); } -#endif // _MSC_VER +#endif // _LIBCPP_MSVCRT #endif // _LIBCPP_SUPPORT_WIN32_MATH_WIN32_H diff --git a/system/include/libcxx/support/win32/support.h b/system/include/libcxx/support/win32/support.h index 0b8a912a..17abb915 100644 --- a/system/include/libcxx/support/win32/support.h +++ b/system/include/libcxx/support/win32/support.h @@ -15,26 +15,23 @@ Functions and constants used in libc++ that are missing from the Windows C library. */ -#include <__config> -#include <wchar.h> // mbstate_t -#include <stdio.h> // _snwprintf +#include <cwchar> // mbstate_t +#include <cstdarg> // va_ macros #define swprintf _snwprintf #define vswprintf _vsnwprintf -#define vfscnaf fscanf -int vasprintf( char **sptr, const char *__restrict fmt , va_list ap ); -int asprintf( char **sptr, const char *__restrict fmt, ...); -//int vfscanf( FILE *__restrict stream, const char *__restrict format, -// va_list arg); +extern "C" { +int vasprintf( char **sptr, const char *__restrict fmt, va_list ap ); +int asprintf( char **sptr, const char *__restrict fmt, ...); size_t mbsnrtowcs( wchar_t *__restrict dst, const char **__restrict src, size_t nmc, size_t len, mbstate_t *__restrict ps ); size_t wcsnrtombs( char *__restrict dst, const wchar_t **__restrict src, size_t nwc, size_t len, mbstate_t *__restrict ps ); +} -#if defined(_MSC_VER) +#if defined(_LIBCPP_MSVCRT) #define snprintf _snprintf - #include <xlocinfo.h> #define atoll _atoi64 #define strtoll _strtoi64 @@ -85,9 +82,11 @@ _LIBCPP_ALWAYS_INLINE int __builtin_ctz( unsigned int x ) _BitScanReverse(&r, x); return static_cast<int>(r); } + // sizeof(long) == sizeof(int) on Windows _LIBCPP_ALWAYS_INLINE int __builtin_ctzl( unsigned long x ) { return __builtin_ctz( static_cast<int>(x) ); } + _LIBCPP_ALWAYS_INLINE int __builtin_ctzll( unsigned long long x ) { DWORD r = 0; @@ -110,6 +109,6 @@ _LIBCPP_ALWAYS_INLINE int __builtin_clzll( unsigned long long x ) return static_cast<int>(r); } #endif // !__clang__ -#endif // _MSC_VER +#endif // _LIBCPP_MSVCRT #endif // _LIBCPP_SUPPORT_WIN32_SUPPORT_H |