Index: include/__nullptr =================================================================== --- include/__nullptr +++ include/__nullptr @@ -1,5 +1,5 @@ // -*- C++ -*- -//===--------------------------- cstddef ----------------------------------===// +//===--------------------------- __nullptr --------------------------------===// // // The LLVM Compiler Infrastructure // @@ -8,53 +8,19 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_CSTDDEF -#define _LIBCPP_CSTDDEF +#ifndef _LIBCPP_NULLPTR +#define _LIBCPP_NULLPTR -/* - cstddef synopsis - -Macros: - - offsetof(type,member-designator) - NULL - -namespace std -{ - -Types: - - ptrdiff_t - size_t - max_align_t - nullptr_t - -} // std - -*/ - #include <__config> -#include - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +#ifdef _LIBCPP_HAS_NO_NULLPTR + _LIBCPP_BEGIN_NAMESPACE_STD -using ::ptrdiff_t; -using ::size_t; - -#if defined(__CLANG_MAX_ALIGN_T_DEFINED) || defined(_GCC_MAX_ALIGN_T) -// Re-use the compiler's max_align_t where possible. -using ::max_align_t; -#else -typedef long double max_align_t; -#endif - -#ifdef _LIBCPP_HAS_NO_NULLPTR - struct _LIBCPP_TYPE_VIS_ONLY nullptr_t { void* __lx; @@ -86,11 +52,9 @@ #define nullptr _VSTD::__get_nullptr_t() -#endif // _LIBCPP_HAS_NO_NULLPTR - _LIBCPP_END_NAMESPACE_STD -#ifndef _LIBCPP_HAS_NO_NULLPTR +#else // _LIBCPP_HAS_NO_NULLPTR namespace std { @@ -99,4 +63,4 @@ #endif // _LIBCPP_HAS_NO_NULLPTR -#endif // _LIBCPP_CSTDDEF +#endif // _LIBCPP_NULLPTR Index: include/cctype =================================================================== --- include/cctype +++ include/cctype @@ -37,10 +37,6 @@ #include <__config> #include -#if defined(_LIBCPP_MSVCRT) -#include "support/win32/support.h" -#include "support/win32/locale_win32.h" -#endif // _LIBCPP_MSVCRT #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -48,117 +44,20 @@ _LIBCPP_BEGIN_NAMESPACE_STD -#ifdef isalnum -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isalnum(int __c) {return isalnum(__c);} -#undef isalnum -inline _LIBCPP_INLINE_VISIBILITY int isalnum(int __c) {return __libcpp_isalnum(__c);} -#else // isalnum using ::isalnum; -#endif // isalnum - -#ifdef isalpha -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isalpha(int __c) {return isalpha(__c);} -#undef isalpha -inline _LIBCPP_INLINE_VISIBILITY int isalpha(int __c) {return __libcpp_isalpha(__c);} -#else // isalpha using ::isalpha; -#endif // isalpha - -#ifdef isblank -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isblank(int __c) {return isblank(__c);} -#undef isblank -inline _LIBCPP_INLINE_VISIBILITY int isblank(int __c) {return __libcpp_isblank(__c);} -#else // isblank using ::isblank; -#endif // isblank - -#ifdef iscntrl -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iscntrl(int __c) {return iscntrl(__c);} -#undef iscntrl -inline _LIBCPP_INLINE_VISIBILITY int iscntrl(int __c) {return __libcpp_iscntrl(__c);} -#else // iscntrl using ::iscntrl; -#endif // iscntrl - -#ifdef isdigit -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isdigit(int __c) {return isdigit(__c);} -#undef isdigit -inline _LIBCPP_INLINE_VISIBILITY int isdigit(int __c) {return __libcpp_isdigit(__c);} -#else // isdigit using ::isdigit; -#endif // isdigit - -#ifdef isgraph -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isgraph(int __c) {return isgraph(__c);} -#undef isgraph -inline _LIBCPP_INLINE_VISIBILITY int isgraph(int __c) {return __libcpp_isgraph(__c);} -#else // isgraph using ::isgraph; -#endif // isgraph - -#ifdef islower -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_islower(int __c) {return islower(__c);} -#undef islower -inline _LIBCPP_INLINE_VISIBILITY int islower(int __c) {return __libcpp_islower(__c);} -#else // islower using ::islower; -#endif // islower - -#ifdef isprint -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isprint(int __c) {return isprint(__c);} -#undef isprint -inline _LIBCPP_INLINE_VISIBILITY int isprint(int __c) {return __libcpp_isprint(__c);} -#else // isprint using ::isprint; -#endif // isprint - -#ifdef ispunct -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_ispunct(int __c) {return ispunct(__c);} -#undef ispunct -inline _LIBCPP_INLINE_VISIBILITY int ispunct(int __c) {return __libcpp_ispunct(__c);} -#else // ispunct using ::ispunct; -#endif // ispunct - -#ifdef isspace -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isspace(int __c) {return isspace(__c);} -#undef isspace -inline _LIBCPP_INLINE_VISIBILITY int isspace(int __c) {return __libcpp_isspace(__c);} -#else // isspace using ::isspace; -#endif // isspace - -#ifdef isupper -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isupper(int __c) {return isupper(__c);} -#undef isupper -inline _LIBCPP_INLINE_VISIBILITY int isupper(int __c) {return __libcpp_isupper(__c);} -#else // isupper using ::isupper; -#endif // isupper - -#ifdef isxdigit -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isxdigit(int __c) {return isxdigit(__c);} -#undef isxdigit -inline _LIBCPP_INLINE_VISIBILITY int isxdigit(int __c) {return __libcpp_isxdigit(__c);} -#else // isxdigit using ::isxdigit; -#endif // isxdigit - -#ifdef tolower -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_tolower(int __c) {return tolower(__c);} -#undef tolower -inline _LIBCPP_INLINE_VISIBILITY int tolower(int __c) {return __libcpp_tolower(__c);} -#else // tolower using ::tolower; -#endif // tolower - -#ifdef toupper -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_toupper(int __c) {return toupper(__c);} -#undef toupper -inline _LIBCPP_INLINE_VISIBILITY int toupper(int __c) {return __libcpp_toupper(__c);} -#else // toupper using ::toupper; -#endif // toupper _LIBCPP_END_NAMESPACE_STD Index: include/cerrno =================================================================== --- include/cerrno +++ include/cerrno @@ -30,364 +30,4 @@ #pragma GCC system_header #endif -#if !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) - -#ifdef ELAST - -const int __elast1 = ELAST+1; -const int __elast2 = ELAST+2; - -#else - -const int __elast1 = 104; -const int __elast2 = 105; - -#endif - -#ifdef ENOTRECOVERABLE - -#define EOWNERDEAD __elast1 - -#ifdef ELAST -#undef ELAST -#define ELAST EOWNERDEAD -#endif - -#elif defined(EOWNERDEAD) - -#define ENOTRECOVERABLE __elast1 -#ifdef ELAST -#undef ELAST -#define ELAST ENOTRECOVERABLE -#endif - -#else // defined(EOWNERDEAD) - -#define EOWNERDEAD __elast1 -#define ENOTRECOVERABLE __elast2 -#ifdef ELAST -#undef ELAST -#define ELAST ENOTRECOVERABLE -#endif - -#endif // defined(EOWNERDEAD) - -#endif // !defined(EOWNERDEAD) || !defined(ENOTRECOVERABLE) - -// supply errno values likely to be missing, particularly on Windows - -#ifndef EAFNOSUPPORT -#define EAFNOSUPPORT 9901 -#endif - -#ifndef EADDRINUSE -#define EADDRINUSE 9902 -#endif - -#ifndef EADDRNOTAVAIL -#define EADDRNOTAVAIL 9903 -#endif - -#ifndef EISCONN -#define EISCONN 9904 -#endif - -#ifndef EBADMSG -#define EBADMSG 9905 -#endif - -#ifndef ECONNABORTED -#define ECONNABORTED 9906 -#endif - -#ifndef EALREADY -#define EALREADY 9907 -#endif - -#ifndef ECONNREFUSED -#define ECONNREFUSED 9908 -#endif - -#ifndef ECONNRESET -#define ECONNRESET 9909 -#endif - -#ifndef EDESTADDRREQ -#define EDESTADDRREQ 9910 -#endif - -#ifndef EHOSTUNREACH -#define EHOSTUNREACH 9911 -#endif - -#ifndef EIDRM -#define EIDRM 9912 -#endif - -#ifndef EMSGSIZE -#define EMSGSIZE 9913 -#endif - -#ifndef ENETDOWN -#define ENETDOWN 9914 -#endif - -#ifndef ENETRESET -#define ENETRESET 9915 -#endif - -#ifndef ENETUNREACH -#define ENETUNREACH 9916 -#endif - -#ifndef ENOBUFS -#define ENOBUFS 9917 -#endif - -#ifndef ENOLINK -#define ENOLINK 9918 -#endif - -#ifndef ENODATA -#define ENODATA 9919 -#endif - -#ifndef ENOMSG -#define ENOMSG 9920 -#endif - -#ifndef ENOPROTOOPT -#define ENOPROTOOPT 9921 -#endif - -#ifndef ENOSR -#define ENOSR 9922 -#endif - -#ifndef ENOTSOCK -#define ENOTSOCK 9923 -#endif - -#ifndef ENOSTR -#define ENOSTR 9924 -#endif - -#ifndef ENOTCONN -#define ENOTCONN 9925 -#endif - -#ifndef ENOTSUP -#define ENOTSUP 9926 -#endif - -#ifndef ECANCELED -#define ECANCELED 9927 -#endif - -#ifndef EINPROGRESS -#define EINPROGRESS 9928 -#endif - -#ifndef EOPNOTSUPP -#define EOPNOTSUPP 9929 -#endif - -#ifndef EWOULDBLOCK -#define EWOULDBLOCK 9930 -#endif - -#ifndef EOWNERDEAD -#define EOWNERDEAD 9931 -#endif - -#ifndef EPROTO -#define EPROTO 9932 -#endif - -#ifndef EPROTONOSUPPORT -#define EPROTONOSUPPORT 9933 -#endif - -#ifndef ENOTRECOVERABLE -#define ENOTRECOVERABLE 9934 -#endif - -#ifndef ETIME -#define ETIME 9935 -#endif - -#ifndef ETXTBSY -#define ETXTBSY 9936 -#endif - -#ifndef ETIMEDOUT -#define ETIMEDOUT 9938 -#endif - -#ifndef ELOOP -#define ELOOP 9939 -#endif - -#ifndef EOVERFLOW -#define EOVERFLOW 9940 -#endif - -#ifndef EPROTOTYPE -#define EPROTOTYPE 9941 -#endif - -#ifndef ENOSYS -#define ENOSYS 9942 -#endif - -#ifndef EINVAL -#define EINVAL 9943 -#endif - -#ifndef ERANGE -#define ERANGE 9944 -#endif - -#ifndef EILSEQ -#define EILSEQ 9945 -#endif - -// Windows Mobile doesn't appear to define these: - -#ifndef E2BIG -#define E2BIG 9946 -#endif - -#ifndef EDOM -#define EDOM 9947 -#endif - -#ifndef EFAULT -#define EFAULT 9948 -#endif - -#ifndef EBADF -#define EBADF 9949 -#endif - -#ifndef EPIPE -#define EPIPE 9950 -#endif - -#ifndef EXDEV -#define EXDEV 9951 -#endif - -#ifndef EBUSY -#define EBUSY 9952 -#endif - -#ifndef ENOTEMPTY -#define ENOTEMPTY 9953 -#endif - -#ifndef ENOEXEC -#define ENOEXEC 9954 -#endif - -#ifndef EEXIST -#define EEXIST 9955 -#endif - -#ifndef EFBIG -#define EFBIG 9956 -#endif - -#ifndef ENAMETOOLONG -#define ENAMETOOLONG 9957 -#endif - -#ifndef ENOTTY -#define ENOTTY 9958 -#endif - -#ifndef EINTR -#define EINTR 9959 -#endif - -#ifndef ESPIPE -#define ESPIPE 9960 -#endif - -#ifndef EIO -#define EIO 9961 -#endif - -#ifndef EISDIR -#define EISDIR 9962 -#endif - -#ifndef ECHILD -#define ECHILD 9963 -#endif - -#ifndef ENOLCK -#define ENOLCK 9964 -#endif - -#ifndef ENOSPC -#define ENOSPC 9965 -#endif - -#ifndef ENXIO -#define ENXIO 9966 -#endif - -#ifndef ENODEV -#define ENODEV 9967 -#endif - -#ifndef ENOENT -#define ENOENT 9968 -#endif - -#ifndef ESRCH -#define ESRCH 9969 -#endif - -#ifndef ENOTDIR -#define ENOTDIR 9970 -#endif - -#ifndef ENOMEM -#define ENOMEM 9971 -#endif - -#ifndef EPERM -#define EPERM 9972 -#endif - -#ifndef EACCES -#define EACCES 9973 -#endif - -#ifndef EROFS -#define EROFS 9974 -#endif - -#ifndef EDEADLK -#define EDEADLK 9975 -#endif - -#ifndef EAGAIN -#define EAGAIN 9976 -#endif - -#ifndef ENFILE -#define ENFILE 9977 -#endif - -#ifndef EMFILE -#define EMFILE 9978 -#endif - -#ifndef EMLINK -#define EMLINK 9979 -#endif - #endif // _LIBCPP_CERRNO Index: include/cfloat =================================================================== --- include/cfloat +++ include/cfloat @@ -67,12 +67,4 @@ #pragma GCC system_header #endif -#ifndef FLT_EVAL_METHOD -#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ -#endif - -#ifndef DECIMAL_DIG -#define DECIMAL_DIG __DECIMAL_DIG__ -#endif - #endif // _LIBCPP_CFLOAT Index: include/cinttypes =================================================================== --- include/cinttypes +++ include/cinttypes @@ -246,10 +246,7 @@ _LIBCPP_BEGIN_NAMESPACE_STD using::imaxdiv_t; - -#undef imaxabs using::imaxabs; -#undef imaxdiv using::imaxdiv; using::strtoimax; using::strtoumax; Index: include/cmath =================================================================== --- include/cmath +++ include/cmath @@ -299,340 +299,11 @@ #include <__config> #include -#include -#ifdef _LIBCPP_MSVCRT -#include "support/win32/math_win32.h" -#endif - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif -// signbit - -#ifdef signbit - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_signbit(_A1 __lcpp_x) _NOEXCEPT -{ - return signbit(__lcpp_x); -} - -#undef signbit - -template -inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if::value, bool>::type -signbit(_A1 __lcpp_x) _NOEXCEPT -{ - return __libcpp_signbit((typename std::__promote<_A1>::type)__lcpp_x); -} - -#endif // signbit - -// fpclassify - -#ifdef fpclassify - -template -_LIBCPP_ALWAYS_INLINE -int -__libcpp_fpclassify(_A1 __lcpp_x) _NOEXCEPT -{ - return fpclassify(__lcpp_x); -} - -#undef fpclassify - -template -inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if::value, int>::type -fpclassify(_A1 __lcpp_x) _NOEXCEPT -{ - return __libcpp_fpclassify((typename std::__promote<_A1>::type)__lcpp_x); -} - -#endif // fpclassify - -// isfinite - -#ifdef isfinite - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_isfinite(_A1 __lcpp_x) _NOEXCEPT -{ - return isfinite(__lcpp_x); -} - -#undef isfinite - -template -inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if::value, bool>::type -isfinite(_A1 __lcpp_x) _NOEXCEPT -{ - return __libcpp_isfinite((typename std::__promote<_A1>::type)__lcpp_x); -} - -#endif // isfinite - -// isinf - -#ifdef isinf - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_isinf(_A1 __lcpp_x) _NOEXCEPT -{ - return isinf(__lcpp_x); -} - -#undef isinf - -template -inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if::value, bool>::type -isinf(_A1 __lcpp_x) _NOEXCEPT -{ - return __libcpp_isinf((typename std::__promote<_A1>::type)__lcpp_x); -} - -#endif // isinf - -// isnan - -#ifdef isnan - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_isnan(_A1 __lcpp_x) _NOEXCEPT -{ - return isnan(__lcpp_x); -} - -#undef isnan - -template -inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if::value, bool>::type -isnan(_A1 __lcpp_x) _NOEXCEPT -{ - return __libcpp_isnan((typename std::__promote<_A1>::type)__lcpp_x); -} - -#endif // isnan - -// isnormal - -#ifdef isnormal - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_isnormal(_A1 __lcpp_x) _NOEXCEPT -{ - return isnormal(__lcpp_x); -} - -#undef isnormal - -template -inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if::value, bool>::type -isnormal(_A1 __lcpp_x) _NOEXCEPT -{ - return __libcpp_isnormal((typename std::__promote<_A1>::type)__lcpp_x); -} - -#endif // isnormal - -// isgreater - -#ifdef isgreater - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - return isgreater(__lcpp_x, __lcpp_y); -} - -#undef isgreater - -template -inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if -< - std::is_arithmetic<_A1>::value && - std::is_arithmetic<_A2>::value, - bool ->::type -isgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - typedef typename std::__promote<_A1, _A2>::type type; - return __libcpp_isgreater((type)__lcpp_x, (type)__lcpp_y); -} - -#endif // isgreater - -// isgreaterequal - -#ifdef isgreaterequal - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - return isgreaterequal(__lcpp_x, __lcpp_y); -} - -#undef isgreaterequal - -template -inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if -< - std::is_arithmetic<_A1>::value && - std::is_arithmetic<_A2>::value, - bool ->::type -isgreaterequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - typedef typename std::__promote<_A1, _A2>::type type; - return __libcpp_isgreaterequal((type)__lcpp_x, (type)__lcpp_y); -} - -#endif // isgreaterequal - -// isless - -#ifdef isless - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - return isless(__lcpp_x, __lcpp_y); -} - -#undef isless - -template -inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if -< - std::is_arithmetic<_A1>::value && - std::is_arithmetic<_A2>::value, - bool ->::type -isless(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - typedef typename std::__promote<_A1, _A2>::type type; - return __libcpp_isless((type)__lcpp_x, (type)__lcpp_y); -} - -#endif // isless - -// islessequal - -#ifdef islessequal - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - return islessequal(__lcpp_x, __lcpp_y); -} - -#undef islessequal - -template -inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if -< - std::is_arithmetic<_A1>::value && - std::is_arithmetic<_A2>::value, - bool ->::type -islessequal(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - typedef typename std::__promote<_A1, _A2>::type type; - return __libcpp_islessequal((type)__lcpp_x, (type)__lcpp_y); -} - -#endif // islessequal - -// islessgreater - -#ifdef islessgreater - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - return islessgreater(__lcpp_x, __lcpp_y); -} - -#undef islessgreater - -template -inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if -< - std::is_arithmetic<_A1>::value && - std::is_arithmetic<_A2>::value, - bool ->::type -islessgreater(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - typedef typename std::__promote<_A1, _A2>::type type; - return __libcpp_islessgreater((type)__lcpp_x, (type)__lcpp_y); -} - -#endif // islessgreater - -// isunordered - -#ifdef isunordered - -template -_LIBCPP_ALWAYS_INLINE -bool -__libcpp_isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - return isunordered(__lcpp_x, __lcpp_y); -} - -#undef isunordered - -template -inline _LIBCPP_INLINE_VISIBILITY -typename std::enable_if -< - std::is_arithmetic<_A1>::value && - std::is_arithmetic<_A2>::value, - bool ->::type -isunordered(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - typedef typename std::__promote<_A1, _A2>::type type; - return __libcpp_isunordered((type)__lcpp_x, (type)__lcpp_y); -} - -#endif // isunordered - _LIBCPP_BEGIN_NAMESPACE_STD using ::signbit; @@ -652,794 +323,130 @@ using ::float_t; using ::double_t; -// abs - -#if defined(__sun__) +#ifndef _AIX using ::abs; #endif -#if !defined(_AIX) && !defined(__sun__) -inline _LIBCPP_INLINE_VISIBILITY -float -abs(float __lcpp_x) _NOEXCEPT {return fabsf(__lcpp_x);} - -inline _LIBCPP_INLINE_VISIBILITY -double -abs(double __lcpp_x) _NOEXCEPT {return fabs(__lcpp_x);} - -inline _LIBCPP_INLINE_VISIBILITY -long double -abs(long double __lcpp_x) _NOEXCEPT {return fabsl(__lcpp_x);} -#endif // !defined(_AIX) - #ifndef __sun__ - -// acos - using ::acos; using ::acosf; - -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float acos(float __lcpp_x) _NOEXCEPT {return acosf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return acosl(__lcpp_x);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -acos(_A1 __lcpp_x) _NOEXCEPT {return acos((double)__lcpp_x);} - -// asin - using ::asin; using ::asinf; - -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float asin(float __lcpp_x) _NOEXCEPT {return asinf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double asin(long double __lcpp_x) _NOEXCEPT {return asinl(__lcpp_x);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -asin(_A1 __lcpp_x) _NOEXCEPT {return asin((double)__lcpp_x);} - -// atan - using ::atan; using ::atanf; - -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float atan(float __lcpp_x) _NOEXCEPT {return atanf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double atan(long double __lcpp_x) _NOEXCEPT {return atanl(__lcpp_x);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -atan(_A1 __lcpp_x) _NOEXCEPT {return atan((double)__lcpp_x);} - -// atan2 - using ::atan2; using ::atan2f; - -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float atan2(float __lcpp_y, float __lcpp_x) _NOEXCEPT {return atan2f(__lcpp_y, __lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __lcpp_y, long double __lcpp_x) _NOEXCEPT {return atan2l(__lcpp_y, __lcpp_x);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if -< - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> ->::type -atan2(_A1 __lcpp_y, _A2 __lcpp_x) _NOEXCEPT -{ - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); - return atan2((__result_type)__lcpp_y, (__result_type)__lcpp_x); -} - -// ceil - using ::ceil; using ::ceilf; - -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float ceil(float __lcpp_x) _NOEXCEPT {return ceilf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __lcpp_x) _NOEXCEPT {return ceill(__lcpp_x);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -ceil(_A1 __lcpp_x) _NOEXCEPT {return ceil((double)__lcpp_x);} - -// cos - using ::cos; using ::cosf; - -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float cos(float __lcpp_x) _NOEXCEPT {return cosf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double cos(long double __lcpp_x) _NOEXCEPT {return cosl(__lcpp_x);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -cos(_A1 __lcpp_x) _NOEXCEPT {return cos((double)__lcpp_x);} - -// cosh - using ::cosh; using ::coshf; - -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float cosh(float __lcpp_x) _NOEXCEPT {return coshf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __lcpp_x) _NOEXCEPT {return coshl(__lcpp_x);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -cosh(_A1 __lcpp_x) _NOEXCEPT {return cosh((double)__lcpp_x);} - #endif // __sun__ -// exp using ::exp; using ::expf; #ifndef __sun__ - -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float exp(float __lcpp_x) _NOEXCEPT {return expf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double exp(long double __lcpp_x) _NOEXCEPT {return expl(__lcpp_x);} -#endif - - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -exp(_A1 __lcpp_x) _NOEXCEPT {return exp((double)__lcpp_x);} - -// fabs - using ::fabs; using ::fabsf; - -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float fabs(float __lcpp_x) _NOEXCEPT {return fabsf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __lcpp_x) _NOEXCEPT {return fabsl(__lcpp_x);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -fabs(_A1 __lcpp_x) _NOEXCEPT {return fabs((double)__lcpp_x);} - -// floor - using ::floor; using ::floorf; +#endif //__sun__ -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float floor(float __lcpp_x) _NOEXCEPT {return floorf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double floor(long double __lcpp_x) _NOEXCEPT {return floorl(__lcpp_x);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -floor(_A1 __lcpp_x) _NOEXCEPT {return floor((double)__lcpp_x);} - -// fmod - -#endif //__sun__ using ::fmod; using ::fmodf; + #ifndef __sun__ - -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float fmod(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fmodf(__lcpp_x, __lcpp_y);} -inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fmodl(__lcpp_x, __lcpp_y);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if -< - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> ->::type -fmod(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); - return fmod((__result_type)__lcpp_x, (__result_type)__lcpp_y); -} - - -// frexp - using ::frexp; using ::frexpf; - -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float frexp(float __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexpf(__lcpp_x, __lcpp_e);} -inline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexpl(__lcpp_x, __lcpp_e);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -frexp(_A1 __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexp((double)__lcpp_x, __lcpp_e);} - -// ldexp - using ::ldexp; using ::ldexpf; +#endif // __sun__ -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float ldexp(float __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexpf(__lcpp_x, __lcpp_e);} -inline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexpl(__lcpp_x, __lcpp_e);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -ldexp(_A1 __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexp((double)__lcpp_x, __lcpp_e);} - -// log - -#endif // __sun__ using ::log; using ::logf; + #ifndef __sun__ - -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float log(float __lcpp_x) _NOEXCEPT {return logf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double log(long double __lcpp_x) _NOEXCEPT {return logl(__lcpp_x);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -log(_A1 __lcpp_x) _NOEXCEPT {return log((double)__lcpp_x);} - - -// log10 - using ::log10; using ::log10f; - -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float log10(float __lcpp_x) _NOEXCEPT {return log10f(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double log10(long double __lcpp_x) _NOEXCEPT {return log10l(__lcpp_x);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -log10(_A1 __lcpp_x) _NOEXCEPT {return log10((double)__lcpp_x);} - -// modf - using ::modf; using ::modff; +#endif // __sun__ -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float modf(float __lcpp_x, float* __lcpp_y) _NOEXCEPT {return modff(__lcpp_x, __lcpp_y);} -inline _LIBCPP_INLINE_VISIBILITY long double modf(long double __lcpp_x, long double* __lcpp_y) _NOEXCEPT {return modfl(__lcpp_x, __lcpp_y);} -#endif - -// pow - -#endif // __sun__ using ::pow; using ::powf; #ifndef __sun__ - -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float pow(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return powf(__lcpp_x, __lcpp_y);} -inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return powl(__lcpp_x, __lcpp_y);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if -< - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> ->::type -pow(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); - return pow((__result_type)__lcpp_x, (__result_type)__lcpp_y); -} - -// sin - using ::sin; using ::sinf; - -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float sin(float __lcpp_x) _NOEXCEPT {return sinf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double sin(long double __lcpp_x) _NOEXCEPT {return sinl(__lcpp_x);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -sin(_A1 __lcpp_x) _NOEXCEPT {return sin((double)__lcpp_x);} - -// sinh - using ::sinh; using ::sinhf; +#endif // __sun__ -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float sinh(float __lcpp_x) _NOEXCEPT {return sinhf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __lcpp_x) _NOEXCEPT {return sinhl(__lcpp_x);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -sinh(_A1 __lcpp_x) _NOEXCEPT {return sinh((double)__lcpp_x);} - -// sqrt - -#endif // __sun__ using ::sqrt; using ::sqrtf; - - -#if !(defined(_LIBCPP_MSVCRT) || defined(__sun__) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float sqrt(float __lcpp_x) _NOEXCEPT {return sqrtf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __lcpp_x) _NOEXCEPT {return sqrtl(__lcpp_x);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -sqrt(_A1 __lcpp_x) _NOEXCEPT {return sqrt((double)__lcpp_x);} - -// tan - using ::tan; using ::tanf; + #ifndef __sun__ - -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float tan(float __lcpp_x) _NOEXCEPT {return tanf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double tan(long double __lcpp_x) _NOEXCEPT {return tanl(__lcpp_x);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -tan(_A1 __lcpp_x) _NOEXCEPT {return tan((double)__lcpp_x);} - -// tanh - using ::tanh; using ::tanhf; -#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) -inline _LIBCPP_INLINE_VISIBILITY float tanh(float __lcpp_x) _NOEXCEPT {return tanhf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __lcpp_x) _NOEXCEPT {return tanhl(__lcpp_x);} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -tanh(_A1 __lcpp_x) _NOEXCEPT {return tanh((double)__lcpp_x);} - -// acosh - #ifndef _LIBCPP_MSVCRT using ::acosh; using ::acoshf; - -inline _LIBCPP_INLINE_VISIBILITY float acosh(float __lcpp_x) _NOEXCEPT {return acoshf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __lcpp_x) _NOEXCEPT {return acoshl(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -acosh(_A1 __lcpp_x) _NOEXCEPT {return acosh((double)__lcpp_x);} -#endif - -// asinh - -#ifndef _LIBCPP_MSVCRT using ::asinh; using ::asinhf; - -inline _LIBCPP_INLINE_VISIBILITY float asinh(float __lcpp_x) _NOEXCEPT {return asinhf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __lcpp_x) _NOEXCEPT {return asinhl(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -asinh(_A1 __lcpp_x) _NOEXCEPT {return asinh((double)__lcpp_x);} -#endif - -// atanh - -#ifndef _LIBCPP_MSVCRT using ::atanh; using ::atanhf; - -inline _LIBCPP_INLINE_VISIBILITY float atanh(float __lcpp_x) _NOEXCEPT {return atanhf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __lcpp_x) _NOEXCEPT {return atanhl(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -atanh(_A1 __lcpp_x) _NOEXCEPT {return atanh((double)__lcpp_x);} -#endif - -// cbrt - -#ifndef _LIBCPP_MSVCRT using ::cbrt; using ::cbrtf; - -inline _LIBCPP_INLINE_VISIBILITY float cbrt(float __lcpp_x) _NOEXCEPT {return cbrtf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __lcpp_x) _NOEXCEPT {return cbrtl(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -cbrt(_A1 __lcpp_x) _NOEXCEPT {return cbrt((double)__lcpp_x);} #endif -// copysign - using ::copysign; using ::copysignf; -#if !defined(_VC_CRT_MAJOR_VERSION) || (_VC_CRT_MAJOR_VERSION < 12) -inline _LIBCPP_INLINE_VISIBILITY float copysign(float __lcpp_x, - float __lcpp_y) _NOEXCEPT { - return copysignf(__lcpp_x, __lcpp_y); -} -inline _LIBCPP_INLINE_VISIBILITY long double -copysign(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT { - return copysignl(__lcpp_x, __lcpp_y); -} -#endif - -template -inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if -< - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> ->::type -copysign(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); - return copysign((__result_type)__lcpp_x, (__result_type)__lcpp_y); -} - #ifndef _LIBCPP_MSVCRT - -// erf - using ::erf; using ::erff; - -inline _LIBCPP_INLINE_VISIBILITY float erf(float __lcpp_x) _NOEXCEPT {return erff(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double erf(long double __lcpp_x) _NOEXCEPT {return erfl(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -erf(_A1 __lcpp_x) _NOEXCEPT {return erf((double)__lcpp_x);} - -// erfc - using ::erfc; using ::erfcf; - -inline _LIBCPP_INLINE_VISIBILITY float erfc(float __lcpp_x) _NOEXCEPT {return erfcf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __lcpp_x) _NOEXCEPT {return erfcl(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -erfc(_A1 __lcpp_x) _NOEXCEPT {return erfc((double)__lcpp_x);} - -// exp2 - using ::exp2; using ::exp2f; - -inline _LIBCPP_INLINE_VISIBILITY float exp2(float __lcpp_x) _NOEXCEPT {return exp2f(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __lcpp_x) _NOEXCEPT {return exp2l(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -exp2(_A1 __lcpp_x) _NOEXCEPT {return exp2((double)__lcpp_x);} - -// expm1 - using ::expm1; using ::expm1f; - -inline _LIBCPP_INLINE_VISIBILITY float expm1(float __lcpp_x) _NOEXCEPT {return expm1f(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __lcpp_x) _NOEXCEPT {return expm1l(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -expm1(_A1 __lcpp_x) _NOEXCEPT {return expm1((double)__lcpp_x);} - -// fdim - using ::fdim; using ::fdimf; - -inline _LIBCPP_INLINE_VISIBILITY float fdim(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fdimf(__lcpp_x, __lcpp_y);} -inline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fdiml(__lcpp_x, __lcpp_y);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if -< - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> ->::type -fdim(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); - return fdim((__result_type)__lcpp_x, (__result_type)__lcpp_y); -} - -// fma - using ::fmaf; using ::fma; - -inline _LIBCPP_INLINE_VISIBILITY float fma(float __lcpp_x, float __lcpp_y, float __lcpp_z) _NOEXCEPT {return fmaf(__lcpp_x, __lcpp_y, __lcpp_z);} -inline _LIBCPP_INLINE_VISIBILITY long double fma(long double __lcpp_x, long double __lcpp_y, long double __lcpp_z) _NOEXCEPT {return fmal(__lcpp_x, __lcpp_y, __lcpp_z);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if -< - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value && - is_arithmetic<_A3>::value, - __promote<_A1, _A2, _A3> ->::type -fma(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT -{ - typedef typename __promote<_A1, _A2, _A3>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value && - is_same<_A3, __result_type>::value)), ""); - return fma((__result_type)__lcpp_x, (__result_type)__lcpp_y, (__result_type)__lcpp_z); -} - -// fmax - using ::fmax; using ::fmaxf; - -inline _LIBCPP_INLINE_VISIBILITY float fmax(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fmaxf(__lcpp_x, __lcpp_y);} -inline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fmaxl(__lcpp_x, __lcpp_y);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if -< - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> ->::type -fmax(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); - return fmax((__result_type)__lcpp_x, (__result_type)__lcpp_y); -} - -// fmin - using ::fmin; using ::fminf; - -inline _LIBCPP_INLINE_VISIBILITY float fmin(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fminf(__lcpp_x, __lcpp_y);} -inline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fminl(__lcpp_x, __lcpp_y);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if -< - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> ->::type -fmin(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); - return fmin((__result_type)__lcpp_x, (__result_type)__lcpp_y); -} - -// hypot - using ::hypot; using ::hypotf; - -inline _LIBCPP_INLINE_VISIBILITY float hypot(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return hypotf(__lcpp_x, __lcpp_y);} -inline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return hypotl(__lcpp_x, __lcpp_y);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if -< - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> ->::type -hypot(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); - return hypot((__result_type)__lcpp_x, (__result_type)__lcpp_y); -} - -// ilogb - using ::ilogb; using ::ilogbf; - -inline _LIBCPP_INLINE_VISIBILITY int ilogb(float __lcpp_x) _NOEXCEPT {return ilogbf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __lcpp_x) _NOEXCEPT {return ilogbl(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, int>::type -ilogb(_A1 __lcpp_x) _NOEXCEPT {return ilogb((double)__lcpp_x);} - -// lgamma - using ::lgamma; using ::lgammaf; - -inline _LIBCPP_INLINE_VISIBILITY float lgamma(float __lcpp_x) _NOEXCEPT {return lgammaf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __lcpp_x) _NOEXCEPT {return lgammal(__lcpp_x);} - - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -lgamma(_A1 __lcpp_x) _NOEXCEPT {return lgamma((double)__lcpp_x);} - - -// llrint - using ::llrint; using ::llrintf; - -inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __lcpp_x) _NOEXCEPT {return llrintf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __lcpp_x) _NOEXCEPT {return llrintl(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, long long>::type -llrint(_A1 __lcpp_x) _NOEXCEPT {return llrint((double)__lcpp_x);} - -// llround - using ::llround; using ::llroundf; - -inline _LIBCPP_INLINE_VISIBILITY long long llround(float __lcpp_x) _NOEXCEPT {return llroundf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __lcpp_x) _NOEXCEPT {return llroundl(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, long long>::type -llround(_A1 __lcpp_x) _NOEXCEPT {return llround((double)__lcpp_x);} - -// log1p - using ::log1p; using ::log1pf; - -inline _LIBCPP_INLINE_VISIBILITY float log1p(float __lcpp_x) _NOEXCEPT {return log1pf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __lcpp_x) _NOEXCEPT {return log1pl(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -log1p(_A1 __lcpp_x) _NOEXCEPT {return log1p((double)__lcpp_x);} - -// log2 - using ::log2; using ::log2f; - -inline _LIBCPP_INLINE_VISIBILITY float log2(float __lcpp_x) _NOEXCEPT {return log2f(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double log2(long double __lcpp_x) _NOEXCEPT {return log2l(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -log2(_A1 __lcpp_x) _NOEXCEPT {return log2((double)__lcpp_x);} - -// logb - using ::logb; using ::logbf; - -inline _LIBCPP_INLINE_VISIBILITY float logb(float __lcpp_x) _NOEXCEPT {return logbf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double logb(long double __lcpp_x) _NOEXCEPT {return logbl(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -logb(_A1 __lcpp_x) _NOEXCEPT {return logb((double)__lcpp_x);} - -// lrint - using ::lrint; using ::lrintf; - -inline _LIBCPP_INLINE_VISIBILITY long lrint(float __lcpp_x) _NOEXCEPT {return lrintf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long lrint(long double __lcpp_x) _NOEXCEPT {return lrintl(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, long>::type -lrint(_A1 __lcpp_x) _NOEXCEPT {return lrint((double)__lcpp_x);} - -// lround - using ::lround; using ::lroundf; - -inline _LIBCPP_INLINE_VISIBILITY long lround(float __lcpp_x) _NOEXCEPT {return lroundf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long lround(long double __lcpp_x) _NOEXCEPT {return lroundl(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, long>::type -lround(_A1 __lcpp_x) _NOEXCEPT {return lround((double)__lcpp_x);} - #endif // _LIBCPP_MSVCRT #endif // __sun__ -// nan - #ifndef _LIBCPP_MSVCRT using ::nan; using ::nanf; @@ -1447,183 +454,28 @@ #ifndef __sun__ #ifndef _LIBCPP_MSVCRT - -// nearbyint - using ::nearbyint; using ::nearbyintf; - -inline _LIBCPP_INLINE_VISIBILITY float nearbyint(float __lcpp_x) _NOEXCEPT {return nearbyintf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __lcpp_x) _NOEXCEPT {return nearbyintl(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -nearbyint(_A1 __lcpp_x) _NOEXCEPT {return nearbyint((double)__lcpp_x);} - -// nextafter - using ::nextafter; using ::nextafterf; - -inline _LIBCPP_INLINE_VISIBILITY float nextafter(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return nextafterf(__lcpp_x, __lcpp_y);} -inline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nextafterl(__lcpp_x, __lcpp_y);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if -< - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> ->::type -nextafter(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); - return nextafter((__result_type)__lcpp_x, (__result_type)__lcpp_y); -} - -// nexttoward - using ::nexttoward; using ::nexttowardf; - -inline _LIBCPP_INLINE_VISIBILITY float nexttoward(float __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttowardf(__lcpp_x, __lcpp_y);} -inline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttowardl(__lcpp_x, __lcpp_y);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -nexttoward(_A1 __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttoward((double)__lcpp_x, __lcpp_y);} - -// remainder - using ::remainder; using ::remainderf; - -inline _LIBCPP_INLINE_VISIBILITY float remainder(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return remainderf(__lcpp_x, __lcpp_y);} -inline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return remainderl(__lcpp_x, __lcpp_y);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if -< - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> ->::type -remainder(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT -{ - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); - return remainder((__result_type)__lcpp_x, (__result_type)__lcpp_y); -} - -// remquo - using ::remquo; using ::remquof; - -inline _LIBCPP_INLINE_VISIBILITY float remquo(float __lcpp_x, float __lcpp_y, int* __lcpp_z) _NOEXCEPT {return remquof(__lcpp_x, __lcpp_y, __lcpp_z);} -inline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __lcpp_x, long double __lcpp_y, int* __lcpp_z) _NOEXCEPT {return remquol(__lcpp_x, __lcpp_y, __lcpp_z);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if -< - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> ->::type -remquo(_A1 __lcpp_x, _A2 __lcpp_y, int* __lcpp_z) _NOEXCEPT -{ - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); - return remquo((__result_type)__lcpp_x, (__result_type)__lcpp_y, __lcpp_z); -} - -// rint - using ::rint; using ::rintf; - -inline _LIBCPP_INLINE_VISIBILITY float rint(float __lcpp_x) _NOEXCEPT {return rintf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double rint(long double __lcpp_x) _NOEXCEPT {return rintl(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -rint(_A1 __lcpp_x) _NOEXCEPT {return rint((double)__lcpp_x);} - -// round - using ::round; using ::roundf; - -inline _LIBCPP_INLINE_VISIBILITY float round(float __lcpp_x) _NOEXCEPT {return roundf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double round(long double __lcpp_x) _NOEXCEPT {return roundl(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -round(_A1 __lcpp_x) _NOEXCEPT {return round((double)__lcpp_x);} - -// scalbln - using ::scalbln; using ::scalblnf; - -inline _LIBCPP_INLINE_VISIBILITY float scalbln(float __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalblnf(__lcpp_x, __lcpp_y);} -inline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalblnl(__lcpp_x, __lcpp_y);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -scalbln(_A1 __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalbln((double)__lcpp_x, __lcpp_y);} - -// scalbn - using ::scalbn; using ::scalbnf; - -inline _LIBCPP_INLINE_VISIBILITY float scalbn(float __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbnf(__lcpp_x, __lcpp_y);} -inline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbnl(__lcpp_x, __lcpp_y);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -scalbn(_A1 __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbn((double)__lcpp_x, __lcpp_y);} - -// tgamma - using ::tgamma; using ::tgammaf; - -inline _LIBCPP_INLINE_VISIBILITY float tgamma(float __lcpp_x) _NOEXCEPT {return tgammaf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __lcpp_x) _NOEXCEPT {return tgammal(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -tgamma(_A1 __lcpp_x) _NOEXCEPT {return tgamma((double)__lcpp_x);} - -// trunc - using ::trunc; using ::truncf; - -inline _LIBCPP_INLINE_VISIBILITY float trunc(float __lcpp_x) _NOEXCEPT {return truncf(__lcpp_x);} -inline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __lcpp_x) _NOEXCEPT {return truncl(__lcpp_x);} - -template -inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type -trunc(_A1 __lcpp_x) _NOEXCEPT {return trunc((double)__lcpp_x);} - #endif // !_LIBCPP_MSVCRT using ::acosl; @@ -1647,6 +499,7 @@ using ::sinhl; using ::sqrtl; using ::tanl; + #ifndef _LIBCPP_MSVCRT using ::tanhl; using ::acoshl; @@ -1654,7 +507,9 @@ using ::atanhl; using ::cbrtl; #endif // !_LIBCPP_MSVCRT + using ::copysignl; + #ifndef _LIBCPP_MSVCRT using ::erfl; using ::erfcl; @@ -1692,6 +547,7 @@ using ::lgamma; using ::lgammaf; #endif // __sun__ + _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP_CMATH Index: include/csetjmp =================================================================== --- include/csetjmp +++ include/csetjmp @@ -38,10 +38,6 @@ #pragma GCC system_header #endif -#ifndef setjmp -#define setjmp(env) setjmp(env) -#endif - _LIBCPP_BEGIN_NAMESPACE_STD using ::jmp_buf; Index: include/cstddef =================================================================== --- include/cstddef +++ include/cstddef @@ -34,9 +34,10 @@ */ #include <__config> +// Don't include our own ; we don't want to declare ::nullptr_t. +#include_next +#include <__nullptr> -#include - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif @@ -53,50 +54,6 @@ typedef long double max_align_t; #endif -#ifdef _LIBCPP_HAS_NO_NULLPTR - -struct _LIBCPP_TYPE_VIS_ONLY nullptr_t -{ - void* __lx; - - struct __nat {int __for_bool_;}; - - _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t() : __lx(0) {} - _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t(int __nat::*) : __lx(0) {} - - _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR operator int __nat::*() const {return 0;} - - template - _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR - operator _Tp* () const {return 0;} - - template - _LIBCPP_ALWAYS_INLINE - operator _Tp _Up::* () const {return 0;} - - friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator==(nullptr_t, nullptr_t) {return true;} - friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator!=(nullptr_t, nullptr_t) {return false;} - friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator<(nullptr_t, nullptr_t) {return false;} - friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator<=(nullptr_t, nullptr_t) {return true;} - friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator>(nullptr_t, nullptr_t) {return false;} - friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator>=(nullptr_t, nullptr_t) {return true;} -}; - -inline _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t __get_nullptr_t() {return nullptr_t(0);} - -#define nullptr _VSTD::__get_nullptr_t() - -#endif // _LIBCPP_HAS_NO_NULLPTR - _LIBCPP_END_NAMESPACE_STD -#ifndef _LIBCPP_HAS_NO_NULLPTR - -namespace std -{ - typedef decltype(nullptr) nullptr_t; -} - -#endif // _LIBCPP_HAS_NO_NULLPTR - #endif // _LIBCPP_CSTDDEF Index: include/cstdio =================================================================== --- include/cstdio +++ include/cstdio @@ -103,41 +103,6 @@ #pragma GCC system_header #endif -// snprintf -#if defined(_LIBCPP_MSVCRT) -#include "support/win32/support.h" -#endif - -#ifdef getc -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_getc(FILE* __stream) {return getc(__stream);} -#undef getc -inline _LIBCPP_INLINE_VISIBILITY int getc(FILE* __stream) {return __libcpp_getc(__stream);} -#endif // getc - -#ifdef putc -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_putc(int __c, FILE* __stream) {return putc(__c, __stream);} -#undef putc -inline _LIBCPP_INLINE_VISIBILITY int putc(int __c, FILE* __stream) {return __libcpp_putc(__c, __stream);} -#endif // putc - -#ifdef clearerr -inline _LIBCPP_INLINE_VISIBILITY void __libcpp_clearerr(FILE* __stream) { return clearerr(__stream); } -#undef clearerr -inline _LIBCPP_INLINE_VISIBILITY void clearerr(FILE* __stream) { return __libcpp_clearerr(__stream); } -#endif // clearerr - -#ifdef feof -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_feof(FILE* __stream) { return feof(__stream); } -#undef feof -inline _LIBCPP_INLINE_VISIBILITY int feof(FILE* __stream) { return __libcpp_feof(__stream); } -#endif // feof - -#ifdef ferror -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_ferror(FILE* __stream) { return ferror(__stream); } -#undef ferror -inline _LIBCPP_INLINE_VISIBILITY int ferror(FILE* __stream) { return __libcpp_ferror(__stream); } -#endif // ferror - _LIBCPP_BEGIN_NAMESPACE_STD using ::FILE; Index: include/cstdlib =================================================================== --- include/cstdlib +++ include/cstdlib @@ -84,9 +84,6 @@ #include <__config> #include -#ifdef _LIBCPP_MSVCRT -#include "support/win32/locale_win32.h" -#endif // _LIBCPP_MSVCRT #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -131,20 +128,14 @@ using ::system; using ::bsearch; using ::qsort; -#undef abs using ::abs; -#undef labs using ::labs; #ifndef _LIBCPP_HAS_NO_LONG_LONG -#undef llabs using ::llabs; #endif // _LIBCPP_HAS_NO_LONG_LONG -#undef div using ::div; -#undef ldiv using ::ldiv; #ifndef _LIBCPP_HAS_NO_LONG_LONG -#undef lldiv using ::lldiv; #endif // _LIBCPP_HAS_NO_LONG_LONG #ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS @@ -162,19 +153,6 @@ using ::aligned_alloc; #endif -// MSVCRT already has the correct prototype in #ifdef __cplusplus -#if !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_AIX) -inline _LIBCPP_INLINE_VISIBILITY long abs( long __x) _NOEXCEPT {return labs(__x);} -#ifndef _LIBCPP_HAS_NO_LONG_LONG -inline _LIBCPP_INLINE_VISIBILITY long long abs(long long __x) _NOEXCEPT {return llabs(__x);} -#endif // _LIBCPP_HAS_NO_LONG_LONG - -inline _LIBCPP_INLINE_VISIBILITY ldiv_t div( long __x, long __y) _NOEXCEPT {return ldiv(__x, __y);} -#ifndef _LIBCPP_HAS_NO_LONG_LONG -inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long __y) _NOEXCEPT {return lldiv(__x, __y);} -#endif // _LIBCPP_HAS_NO_LONG_LONG -#endif // _LIBCPP_MSVCRT - _LIBCPP_END_NAMESPACE_STD #endif // _LIBCPP_CSTDLIB Index: include/cstring =================================================================== --- include/cstring +++ include/cstring @@ -78,30 +78,13 @@ using ::strncmp; using ::strcoll; using ::strxfrm; - using ::memchr; - using ::strchr; - using ::strcspn; - using ::strpbrk; - using ::strrchr; - using ::strspn; - using ::strstr; - -// MSVCRT, GNU libc and its derivates already have the correct prototype in #ifdef __cplusplus -#if !defined(__GLIBC__) && !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_STRING_H_CPLUSPLUS_98_CONFORMANCE_) -inline _LIBCPP_INLINE_VISIBILITY char* strchr( char* __s, int __c) {return ::strchr(__s, __c);} -inline _LIBCPP_INLINE_VISIBILITY char* strpbrk( char* __s1, const char* __s2) {return ::strpbrk(__s1, __s2);} -inline _LIBCPP_INLINE_VISIBILITY char* strrchr( char* __s, int __c) {return ::strrchr(__s, __c);} -inline _LIBCPP_INLINE_VISIBILITY void* memchr( void* __s, int __c, size_t __n) {return ::memchr(__s, __c, __n);} -inline _LIBCPP_INLINE_VISIBILITY char* strstr( char* __s1, const char* __s2) {return ::strstr(__s1, __s2);} -#endif - #ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS using ::strtok; #endif Index: include/ctype.h =================================================================== --- include/ctype.h +++ include/ctype.h @@ -1,5 +1,5 @@ // -*- C++ -*- -//===---------------------------- cctype ----------------------------------===// +//===---------------------------- ctype.h ---------------------------------===// // // The LLVM Compiler Infrastructure // @@ -8,15 +8,12 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_CCTYPE -#define _LIBCPP_CCTYPE +#ifndef _LIBCPP_CTYPE_H +#define _LIBCPP_CTYPE_H /* - cctype synopsis + ctype.h synopsis -namespace std -{ - int isalnum(int c); int isalpha(int c); int isblank(int c); // C99 @@ -31,135 +28,41 @@ int isxdigit(int c); int tolower(int c); int toupper(int c); - -} // std */ #include <__config> -#include -#if defined(_LIBCPP_MSVCRT) -#include "support/win32/support.h" -#include "support/win32/locale_win32.h" -#endif // _LIBCPP_MSVCRT +#include_next #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif -_LIBCPP_BEGIN_NAMESPACE_STD +#ifdef __cplusplus -#ifdef isalnum -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isalnum(int __c) {return isalnum(__c);} +#if defined(_LIBCPP_MSVCRT) +// We support including .h headers inside 'extern "C"' contexts, so switch +// back to C++ linkage before including these C++ headers. +extern "C++" { + #include "support/win32/support.h" + #include "support/win32/locale_win32.h" +} +#endif // _LIBCPP_MSVCRT + #undef isalnum -inline _LIBCPP_INLINE_VISIBILITY int isalnum(int __c) {return __libcpp_isalnum(__c);} -#else // isalnum -using ::isalnum; -#endif // isalnum - -#ifdef isalpha -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isalpha(int __c) {return isalpha(__c);} #undef isalpha -inline _LIBCPP_INLINE_VISIBILITY int isalpha(int __c) {return __libcpp_isalpha(__c);} -#else // isalpha -using ::isalpha; -#endif // isalpha - -#ifdef isblank -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isblank(int __c) {return isblank(__c);} #undef isblank -inline _LIBCPP_INLINE_VISIBILITY int isblank(int __c) {return __libcpp_isblank(__c);} -#else // isblank -using ::isblank; -#endif // isblank - -#ifdef iscntrl -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iscntrl(int __c) {return iscntrl(__c);} #undef iscntrl -inline _LIBCPP_INLINE_VISIBILITY int iscntrl(int __c) {return __libcpp_iscntrl(__c);} -#else // iscntrl -using ::iscntrl; -#endif // iscntrl - -#ifdef isdigit -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isdigit(int __c) {return isdigit(__c);} #undef isdigit -inline _LIBCPP_INLINE_VISIBILITY int isdigit(int __c) {return __libcpp_isdigit(__c);} -#else // isdigit -using ::isdigit; -#endif // isdigit - -#ifdef isgraph -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isgraph(int __c) {return isgraph(__c);} #undef isgraph -inline _LIBCPP_INLINE_VISIBILITY int isgraph(int __c) {return __libcpp_isgraph(__c);} -#else // isgraph -using ::isgraph; -#endif // isgraph - -#ifdef islower -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_islower(int __c) {return islower(__c);} #undef islower -inline _LIBCPP_INLINE_VISIBILITY int islower(int __c) {return __libcpp_islower(__c);} -#else // islower -using ::islower; -#endif // islower - -#ifdef isprint -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isprint(int __c) {return isprint(__c);} #undef isprint -inline _LIBCPP_INLINE_VISIBILITY int isprint(int __c) {return __libcpp_isprint(__c);} -#else // isprint -using ::isprint; -#endif // isprint - -#ifdef ispunct -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_ispunct(int __c) {return ispunct(__c);} #undef ispunct -inline _LIBCPP_INLINE_VISIBILITY int ispunct(int __c) {return __libcpp_ispunct(__c);} -#else // ispunct -using ::ispunct; -#endif // ispunct - -#ifdef isspace -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isspace(int __c) {return isspace(__c);} #undef isspace -inline _LIBCPP_INLINE_VISIBILITY int isspace(int __c) {return __libcpp_isspace(__c);} -#else // isspace -using ::isspace; -#endif // isspace - -#ifdef isupper -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isupper(int __c) {return isupper(__c);} #undef isupper -inline _LIBCPP_INLINE_VISIBILITY int isupper(int __c) {return __libcpp_isupper(__c);} -#else // isupper -using ::isupper; -#endif // isupper - -#ifdef isxdigit -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_isxdigit(int __c) {return isxdigit(__c);} #undef isxdigit -inline _LIBCPP_INLINE_VISIBILITY int isxdigit(int __c) {return __libcpp_isxdigit(__c);} -#else // isxdigit -using ::isxdigit; -#endif // isxdigit - -#ifdef tolower -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_tolower(int __c) {return tolower(__c);} #undef tolower -inline _LIBCPP_INLINE_VISIBILITY int tolower(int __c) {return __libcpp_tolower(__c);} -#else // tolower -using ::tolower; -#endif // tolower - -#ifdef toupper -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_toupper(int __c) {return toupper(__c);} #undef toupper -inline _LIBCPP_INLINE_VISIBILITY int toupper(int __c) {return __libcpp_toupper(__c);} -#else // toupper -using ::toupper; -#endif // toupper -_LIBCPP_END_NAMESPACE_STD +#endif -#endif // _LIBCPP_CCTYPE +#endif // _LIBCPP_CTYPE_H Index: include/cwchar =================================================================== --- include/cwchar +++ include/cwchar @@ -106,9 +106,6 @@ #include <__config> #include #include -#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__) -#include // pull in *swprintf defines -#endif // _LIBCPP_MSVCRT #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -161,16 +158,13 @@ using ::wcsncmp; using ::wcsxfrm; -#if defined(_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_) - +#ifdef _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS using ::wcschr; using ::wcspbrk; using ::wcsrchr; using ::wcsstr; using ::wmemchr; - #else - inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);} inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcschr( wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);} @@ -185,7 +179,6 @@ inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return ::wmemchr(__s, __c, __n);} inline _LIBCPP_INLINE_VISIBILITY wchar_t* wmemchr( wchar_t* __s, wchar_t __c, size_t __n) {return ::wmemchr(__s, __c, __n);} - #endif using ::wcscspn; Index: include/cwctype =================================================================== --- include/cwctype +++ include/cwctype @@ -63,150 +63,24 @@ using ::wint_t; using ::wctrans_t; using ::wctype_t; - -#ifdef iswalnum -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswalnum(wint_t __wc) {return iswalnum(__wc);} -#undef iswalnum -inline _LIBCPP_INLINE_VISIBILITY int iswalnum(wint_t __wc) {return __libcpp_iswalnum(__wc);} -#else // iswalnum using ::iswalnum; -#endif - -#ifdef iswalpha -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswalpha(wint_t __wc) {return iswalpha(__wc);} -#undef iswalpha -inline _LIBCPP_INLINE_VISIBILITY int iswalpha(wint_t __wc) {return __libcpp_iswalpha(__wc);} -#else // iswalpha using ::iswalpha; -#endif - -#ifdef iswblank -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswblank(wint_t __wc) {return iswblank(__wc);} -#undef iswblank -inline _LIBCPP_INLINE_VISIBILITY int iswblank(wint_t __wc) {return __libcpp_iswblank(__wc);} -#else // iswblank using ::iswblank; -#endif - -#ifdef iswcntrl -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswcntrl(wint_t __wc) {return iswcntrl(__wc);} -#undef iswcntrl -inline _LIBCPP_INLINE_VISIBILITY int iswcntrl(wint_t __wc) {return __libcpp_iswcntrl(__wc);} -#else // iswcntrl using ::iswcntrl; -#endif - -#ifdef iswdigit -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswdigit(wint_t __wc) {return iswdigit(__wc);} -#undef iswdigit -inline _LIBCPP_INLINE_VISIBILITY int iswdigit(wint_t __wc) {return __libcpp_iswdigit(__wc);} -#else // iswdigit using ::iswdigit; -#endif - -#ifdef iswgraph -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswgraph(wint_t __wc) {return iswgraph(__wc);} -#undef iswgraph -inline _LIBCPP_INLINE_VISIBILITY int iswgraph(wint_t __wc) {return __libcpp_iswgraph(__wc);} -#else // iswgraph using ::iswgraph; -#endif - -#ifdef iswlower -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswlower(wint_t __wc) {return iswlower(__wc);} -#undef iswlower -inline _LIBCPP_INLINE_VISIBILITY int iswlower(wint_t __wc) {return __libcpp_iswlower(__wc);} -#else // iswlower using ::iswlower; -#endif - -#ifdef iswprint -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswprint(wint_t __wc) {return iswprint(__wc);} -#undef iswprint -inline _LIBCPP_INLINE_VISIBILITY int iswprint(wint_t __wc) {return __libcpp_iswprint(__wc);} -#else // iswprint using ::iswprint; -#endif - -#ifdef iswpunct -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswpunct(wint_t __wc) {return iswpunct(__wc);} -#undef iswpunct -inline _LIBCPP_INLINE_VISIBILITY int iswpunct(wint_t __wc) {return __libcpp_iswpunct(__wc);} -#else // iswpunct using ::iswpunct; -#endif - -#ifdef iswspace -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswspace(wint_t __wc) {return iswspace(__wc);} -#undef iswspace -inline _LIBCPP_INLINE_VISIBILITY int iswspace(wint_t __wc) {return __libcpp_iswspace(__wc);} -#else // iswspace using ::iswspace; -#endif - -#ifdef iswupper -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswupper(wint_t __wc) {return iswupper(__wc);} -#undef iswupper -inline _LIBCPP_INLINE_VISIBILITY int iswupper(wint_t __wc) {return __libcpp_iswupper(__wc);} -#else // iswupper using ::iswupper; -#endif - -#ifdef iswxdigit -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswxdigit(wint_t __wc) {return iswxdigit(__wc);} -#undef iswxdigit -inline _LIBCPP_INLINE_VISIBILITY int iswxdigit(wint_t __wc) {return __libcpp_iswxdigit(__wc);} -#else // iswxdigit using ::iswxdigit; -#endif - -#ifdef iswctype -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswctype(wint_t __w, wctype_t __d) {return iswctype(__w, __d);} -#undef iswctype -inline _LIBCPP_INLINE_VISIBILITY int iswctype(wint_t __w, wctype_t __d) {return __libcpp_iswctype(__w, __d);} -#else // iswctype using ::iswctype; -#endif - -#ifdef wctype -inline _LIBCPP_INLINE_VISIBILITY wctype_t __libcpp_wctype(const char* __p) {return wctype(__p);} -#undef wctype -inline _LIBCPP_INLINE_VISIBILITY wctype_t wctype(const char* __p) {return __libcpp_wctype(__p);} -#else // wctype using ::wctype; -#endif - -#ifdef towlower -inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towlower(wint_t __wc) {return towlower(__wc);} -#undef towlower -inline _LIBCPP_INLINE_VISIBILITY wint_t towlower(wint_t __wc) {return __libcpp_towlower(__wc);} -#else // towlower using ::towlower; -#endif - -#ifdef towupper -inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towupper(wint_t __wc) {return towupper(__wc);} -#undef towupper -inline _LIBCPP_INLINE_VISIBILITY wint_t towupper(wint_t __wc) {return __libcpp_towupper(__wc);} -#else // towupper using ::towupper; -#endif - -#ifdef towctrans -inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towctrans(wint_t __wc, wctype_t __d) {return towctrans(__wc, __d);} -#undef towctrans -inline _LIBCPP_INLINE_VISIBILITY wint_t towctrans(wint_t __wc, wctype_t __d) {return __libcpp_towctrans(__wc, __d);} -#else // towctrans using ::towctrans; -#endif - -#ifdef wctrans -inline _LIBCPP_INLINE_VISIBILITY wctrans_t __libcpp_wctrans(const char* __p) {return wctrans(__p);} -#undef wctrans -inline _LIBCPP_INLINE_VISIBILITY wctrans_t wctrans(const char* __p) {return __libcpp_wctrans(__p);} -#else // wctrans using ::wctrans; -#endif _LIBCPP_END_NAMESPACE_STD Index: include/deque =================================================================== --- include/deque +++ include/deque @@ -261,8 +261,19 @@ __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1> __l, __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r); +template +struct __deque_block_size { + static const _DiffType value = sizeof(_ValueType) < 256 ? 4096 / sizeof(_ValueType) : 16; +}; + template + class _DiffType, _DiffType _BS = +#ifdef _LIBCPP_NEW_DEQUE_ABI + 0 +#else + __deque_block_size<_ValueType, _DiffType>::value +#endif + > class _LIBCPP_TYPE_VIS_ONLY __deque_iterator { typedef _MapPointer __map_iterator; @@ -273,7 +284,7 @@ __map_iterator __m_iter_; pointer __ptr_; - static const difference_type __block_size = _BlockSize; + static const difference_type __block_size; public: typedef _ValueType value_type; typedef random_access_iterator_tag iterator_category; @@ -287,7 +298,7 @@ template _LIBCPP_INLINE_VISIBILITY - __deque_iterator(const __deque_iterator& __it, + __deque_iterator(const __deque_iterator& __it, typename enable_if::value>::type* = 0) _NOEXCEPT : __m_iter_(__it.__m_iter_), __ptr_(__it.__ptr_) {} @@ -520,6 +531,12 @@ __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2> __r); }; +template +const _DiffType __deque_iterator<_ValueType, _Pointer, _Reference, _MapPointer, + _DiffType, _BlockSize>::__block_size = + __deque_block_size<_ValueType, _DiffType>::value; + // copy template ::difference_type difference_type; typedef typename __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2>::pointer pointer; + const difference_type __block_size = __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2>::__block_size; while (__f != __l) { pointer __rb = __r.__ptr_; - pointer __re = *__r.__m_iter_ + _B2; + pointer __re = *__r.__m_iter_ + __block_size; difference_type __bs = __re - __rb; difference_type __n = __l - __f; _RAIter __m = __l; @@ -560,11 +578,12 @@ { typedef typename __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::difference_type difference_type; typedef typename __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::pointer pointer; + const difference_type __block_size = __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::__block_size; difference_type __n = __l - __f; while (__n > 0) { pointer __fb = __f.__ptr_; - pointer __fe = *__f.__m_iter_ + _B1; + pointer __fe = *__f.__m_iter_ + __block_size; difference_type __bs = __fe - __fb; if (__bs > __n) { @@ -587,11 +606,12 @@ { typedef typename __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::difference_type difference_type; typedef typename __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::pointer pointer; + const difference_type __block_size = __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::__block_size; difference_type __n = __l - __f; while (__n > 0) { pointer __fb = __f.__ptr_; - pointer __fe = *__f.__m_iter_ + _B1; + pointer __fe = *__f.__m_iter_ + __block_size; difference_type __bs = __fe - __fb; if (__bs > __n) { @@ -705,10 +725,11 @@ { typedef typename __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2>::difference_type difference_type; typedef typename __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2>::pointer pointer; + const difference_type __block_size = __deque_iterator<_V2, _P2, _R2, _M2, _D2, _B2>::__block_size; while (__f != __l) { pointer __rb = __r.__ptr_; - pointer __re = *__r.__m_iter_ + _B2; + pointer __re = *__r.__m_iter_ + __block_size; difference_type __bs = __re - __rb; difference_type __n = __l - __f; _RAIter __m = __l; @@ -733,11 +754,12 @@ { typedef typename __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::difference_type difference_type; typedef typename __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::pointer pointer; + const difference_type __block_size = __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::__block_size; difference_type __n = __l - __f; while (__n > 0) { pointer __fb = __f.__ptr_; - pointer __fe = *__f.__m_iter_ + _B1; + pointer __fe = *__f.__m_iter_ + __block_size; difference_type __bs = __fe - __fb; if (__bs > __n) { @@ -760,11 +782,12 @@ { typedef typename __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::difference_type difference_type; typedef typename __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::pointer pointer; + const difference_type __block_size = __deque_iterator<_V1, _P1, _R1, _M1, _D1, _B1>::__block_size; difference_type __n = __l - __f; while (__n > 0) { pointer __fb = __f.__ptr_; - pointer __fe = *__f.__m_iter_ + _B1; + pointer __fe = *__f.__m_iter_ + __block_size; difference_type __bs = __fe - __fb; if (__bs > __n) { @@ -909,7 +932,7 @@ typedef typename __alloc_traits::pointer pointer; typedef typename __alloc_traits::const_pointer const_pointer; - static const difference_type __block_size = sizeof(value_type) < 256 ? 4096 / sizeof(value_type) : 16; + static const difference_type __block_size; typedef typename __rebind_alloc_helper<__alloc_traits, pointer>::type __pointer_allocator; typedef allocator_traits<__pointer_allocator> __map_traits; @@ -919,9 +942,9 @@ typedef __split_buffer __map; typedef __deque_iterator iterator; + difference_type> iterator; typedef __deque_iterator const_iterator; + difference_type> const_iterator; __map __map_; size_type __start_; @@ -997,6 +1020,11 @@ }; template +const typename __deque_base<_Tp, _Allocator>::difference_type + __deque_base<_Tp, _Allocator>::__block_size = + __deque_block_size::value; + +template bool __deque_base<_Tp, _Allocator>::__invariants() const { Index: include/errno.h =================================================================== --- include/errno.h +++ include/errno.h @@ -1,5 +1,5 @@ // -*- C++ -*- -//===-------------------------- cerrno ------------------------------------===// +//===-------------------------- errno.h -----------------------------------===// // // The LLVM Compiler Infrastructure // @@ -8,11 +8,11 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_CERRNO -#define _LIBCPP_CERRNO +#ifndef _LIBCPP_ERRNO_H +#define _LIBCPP_ERRNO_H /* - cerrno synopsis + errno.h synopsis Macros: @@ -24,7 +24,7 @@ */ #include <__config> -#include +#include_next #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -34,13 +34,13 @@ #ifdef ELAST -const int __elast1 = ELAST+1; -const int __elast2 = ELAST+2; +static const int __elast1 = ELAST+1; +static const int __elast2 = ELAST+2; #else -const int __elast1 = 104; -const int __elast2 = 105; +static const int __elast1 = 104; +static const int __elast2 = 105; #endif @@ -390,4 +390,4 @@ #define EMLINK 9979 #endif -#endif // _LIBCPP_CERRNO +#endif // _LIBCPP_ERRNO_H Index: include/float.h =================================================================== --- include/float.h +++ include/float.h @@ -1,5 +1,5 @@ // -*- C++ -*- -//===--------------------------- cfloat -----------------------------------===// +//===--------------------------- float.h ----------------------------------===// // // The LLVM Compiler Infrastructure // @@ -8,11 +8,11 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_CFLOAT -#define _LIBCPP_CFLOAT +#ifndef _LIBCPP_FLOAT_H +#define _LIBCPP_FLOAT_H /* - cfloat synopsis + float.h synopsis Macros: @@ -61,7 +61,7 @@ */ #include <__config> -#include +#include_next #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -75,4 +75,4 @@ #define DECIMAL_DIG __DECIMAL_DIG__ #endif -#endif // _LIBCPP_CFLOAT +#endif // _LIBCPP_FLOAT_H Index: include/inttypes.h =================================================================== --- include/inttypes.h +++ include/inttypes.h @@ -1,5 +1,5 @@ // -*- C++ -*- -//===--------------------------- cinttypes --------------------------------===// +//===--------------------------- inttypes.h -------------------------------===// // // The LLVM Compiler Infrastructure // @@ -8,15 +8,15 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_CINTTYPES -#define _LIBCPP_CINTTYPES +#ifndef _LIBCPP_INTTYPES_H +#define _LIBCPP_INTTYPES_H /* - cinttypes synopsis + inttypes.h synopsis This entire header is C99 / C++0X -#include // includes +#include // includes Macros: @@ -218,9 +218,6 @@ SCNxMAX SCNxPTR -namespace std -{ - Types: imaxdiv_t @@ -232,30 +229,22 @@ intmax_t wcstoimax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); uintmax_t wcstoumax(const wchar_t* restrict nptr, wchar_t** restrict endptr, int base); -} // std */ #include <__config> -#include -#include +#include_next #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif -_LIBCPP_BEGIN_NAMESPACE_STD +#ifdef __cplusplus -using::imaxdiv_t; +#include #undef imaxabs -using::imaxabs; #undef imaxdiv -using::imaxdiv; -using::strtoimax; -using::strtoumax; -using::wcstoimax; -using::wcstoumax; -_LIBCPP_END_NAMESPACE_STD +#endif -#endif // _LIBCPP_CINTTYPES +#endif // _LIBCPP_INTTYPES_H Index: include/math.h =================================================================== --- include/math.h +++ include/math.h @@ -1,5 +1,5 @@ // -*- C++ -*- -//===---------------------------- cmath -----------------------------------===// +//===---------------------------- math.h ----------------------------------===// // // The LLVM Compiler Infrastructure // @@ -8,11 +8,11 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_CMATH -#define _LIBCPP_CMATH +#ifndef _LIBCPP_MATH_H +#define _LIBCPP_MATH_H /* - cmath synopsis + math.h synopsis Macros: @@ -35,9 +35,6 @@ MATH_ERREXCEPT // C99 math_errhandling // C99 -namespace std -{ - Types: float_t // C99 @@ -293,12 +290,21 @@ float truncf(float x); long double truncl(long double x); -} // std - */ #include <__config> -#include +#include_next + +#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) +#pragma GCC system_header +#endif + +#ifdef __cplusplus + +// We support including .h headers inside 'extern "C"' contexts, so switch +// back to C++ linkage before including these C++ headers. +extern "C++" { + #include #ifdef _LIBCPP_MSVCRT @@ -305,10 +311,6 @@ #include "support/win32/math_win32.h" #endif -#if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) -#pragma GCC system_header -#endif - // signbit #ifdef signbit @@ -633,32 +635,11 @@ #endif // isunordered -_LIBCPP_BEGIN_NAMESPACE_STD +#ifndef __sun__ -using ::signbit; -using ::fpclassify; -using ::isfinite; -using ::isinf; -using ::isnan; -using ::isnormal; -using ::isgreater; -using ::isgreaterequal; -using ::isless; -using ::islessequal; -using ::islessgreater; -using ::isunordered; -using ::isunordered; - -using ::float_t; -using ::double_t; - // abs -#if defined(__sun__) -using ::abs; -#endif - -#if !defined(_AIX) && !defined(__sun__) +#if !defined(_AIX) inline _LIBCPP_INLINE_VISIBILITY float abs(float __lcpp_x) _NOEXCEPT {return fabsf(__lcpp_x);} @@ -672,13 +653,8 @@ abs(long double __lcpp_x) _NOEXCEPT {return fabsl(__lcpp_x);} #endif // !defined(_AIX) -#ifndef __sun__ - // acos -using ::acos; -using ::acosf; - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float acos(float __lcpp_x) _NOEXCEPT {return acosf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double acos(long double __lcpp_x) _NOEXCEPT {return acosl(__lcpp_x);} @@ -686,14 +662,11 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type acos(_A1 __lcpp_x) _NOEXCEPT {return acos((double)__lcpp_x);} // asin -using ::asin; -using ::asinf; - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float asin(float __lcpp_x) _NOEXCEPT {return asinf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double asin(long double __lcpp_x) _NOEXCEPT {return asinl(__lcpp_x);} @@ -701,14 +674,11 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type asin(_A1 __lcpp_x) _NOEXCEPT {return asin((double)__lcpp_x);} // atan -using ::atan; -using ::atanf; - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float atan(float __lcpp_x) _NOEXCEPT {return atanf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double atan(long double __lcpp_x) _NOEXCEPT {return atanl(__lcpp_x);} @@ -716,14 +686,11 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type atan(_A1 __lcpp_x) _NOEXCEPT {return atan((double)__lcpp_x);} // atan2 -using ::atan2; -using ::atan2f; - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float atan2(float __lcpp_y, float __lcpp_x) _NOEXCEPT {return atan2f(__lcpp_y, __lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double atan2(long double __lcpp_y, long double __lcpp_x) _NOEXCEPT {return atan2l(__lcpp_y, __lcpp_x);} @@ -731,25 +698,22 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if +typename std::__lazy_enable_if < - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, + std::__promote<_A1, _A2> >::type atan2(_A1 __lcpp_y, _A2 __lcpp_x) _NOEXCEPT { - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); + typedef typename std::__promote<_A1, _A2>::type __result_type; + static_assert((!(std::is_same<_A1, __result_type>::value && + std::is_same<_A2, __result_type>::value)), ""); return atan2((__result_type)__lcpp_y, (__result_type)__lcpp_x); } // ceil -using ::ceil; -using ::ceilf; - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float ceil(float __lcpp_x) _NOEXCEPT {return ceilf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double ceil(long double __lcpp_x) _NOEXCEPT {return ceill(__lcpp_x);} @@ -757,14 +721,11 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type ceil(_A1 __lcpp_x) _NOEXCEPT {return ceil((double)__lcpp_x);} // cos -using ::cos; -using ::cosf; - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float cos(float __lcpp_x) _NOEXCEPT {return cosf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double cos(long double __lcpp_x) _NOEXCEPT {return cosl(__lcpp_x);} @@ -772,14 +733,11 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type cos(_A1 __lcpp_x) _NOEXCEPT {return cos((double)__lcpp_x);} // cosh -using ::cosh; -using ::coshf; - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float cosh(float __lcpp_x) _NOEXCEPT {return coshf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double cosh(long double __lcpp_x) _NOEXCEPT {return coshl(__lcpp_x);} @@ -787,33 +745,23 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type cosh(_A1 __lcpp_x) _NOEXCEPT {return cosh((double)__lcpp_x);} -#endif // __sun__ // exp -using ::exp; -using ::expf; - -#ifndef __sun__ - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float exp(float __lcpp_x) _NOEXCEPT {return expf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double exp(long double __lcpp_x) _NOEXCEPT {return expl(__lcpp_x);} #endif - template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type exp(_A1 __lcpp_x) _NOEXCEPT {return exp((double)__lcpp_x);} // fabs -using ::fabs; -using ::fabsf; - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float fabs(float __lcpp_x) _NOEXCEPT {return fabsf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double fabs(long double __lcpp_x) _NOEXCEPT {return fabsl(__lcpp_x);} @@ -821,14 +769,11 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type fabs(_A1 __lcpp_x) _NOEXCEPT {return fabs((double)__lcpp_x);} // floor -using ::floor; -using ::floorf; - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float floor(float __lcpp_x) _NOEXCEPT {return floorf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double floor(long double __lcpp_x) _NOEXCEPT {return floorl(__lcpp_x);} @@ -836,16 +781,11 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type floor(_A1 __lcpp_x) _NOEXCEPT {return floor((double)__lcpp_x);} // fmod -#endif //__sun__ -using ::fmod; -using ::fmodf; -#ifndef __sun__ - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float fmod(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fmodf(__lcpp_x, __lcpp_y);} inline _LIBCPP_INLINE_VISIBILITY long double fmod(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fmodl(__lcpp_x, __lcpp_y);} @@ -853,26 +793,22 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if +typename std::__lazy_enable_if < - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, + std::__promote<_A1, _A2> >::type fmod(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT { - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); + typedef typename std::__promote<_A1, _A2>::type __result_type; + static_assert((!(std::is_same<_A1, __result_type>::value && + std::is_same<_A2, __result_type>::value)), ""); return fmod((__result_type)__lcpp_x, (__result_type)__lcpp_y); } - // frexp -using ::frexp; -using ::frexpf; - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float frexp(float __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexpf(__lcpp_x, __lcpp_e);} inline _LIBCPP_INLINE_VISIBILITY long double frexp(long double __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexpl(__lcpp_x, __lcpp_e);} @@ -880,14 +816,11 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type frexp(_A1 __lcpp_x, int* __lcpp_e) _NOEXCEPT {return frexp((double)__lcpp_x, __lcpp_e);} // ldexp -using ::ldexp; -using ::ldexpf; - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float ldexp(float __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexpf(__lcpp_x, __lcpp_e);} inline _LIBCPP_INLINE_VISIBILITY long double ldexp(long double __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexpl(__lcpp_x, __lcpp_e);} @@ -895,16 +828,11 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type ldexp(_A1 __lcpp_x, int __lcpp_e) _NOEXCEPT {return ldexp((double)__lcpp_x, __lcpp_e);} // log -#endif // __sun__ -using ::log; -using ::logf; -#ifndef __sun__ - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float log(float __lcpp_x) _NOEXCEPT {return logf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double log(long double __lcpp_x) _NOEXCEPT {return logl(__lcpp_x);} @@ -912,15 +840,11 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type log(_A1 __lcpp_x) _NOEXCEPT {return log((double)__lcpp_x);} - // log10 -using ::log10; -using ::log10f; - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float log10(float __lcpp_x) _NOEXCEPT {return log10f(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double log10(long double __lcpp_x) _NOEXCEPT {return log10l(__lcpp_x);} @@ -928,14 +852,11 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type log10(_A1 __lcpp_x) _NOEXCEPT {return log10((double)__lcpp_x);} // modf -using ::modf; -using ::modff; - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float modf(float __lcpp_x, float* __lcpp_y) _NOEXCEPT {return modff(__lcpp_x, __lcpp_y);} inline _LIBCPP_INLINE_VISIBILITY long double modf(long double __lcpp_x, long double* __lcpp_y) _NOEXCEPT {return modfl(__lcpp_x, __lcpp_y);} @@ -943,12 +864,6 @@ // pow -#endif // __sun__ -using ::pow; -using ::powf; - -#ifndef __sun__ - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float pow(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return powf(__lcpp_x, __lcpp_y);} inline _LIBCPP_INLINE_VISIBILITY long double pow(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return powl(__lcpp_x, __lcpp_y);} @@ -956,25 +871,22 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if +typename std::__lazy_enable_if < - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, + std::__promote<_A1, _A2> >::type pow(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT { - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); + typedef typename std::__promote<_A1, _A2>::type __result_type; + static_assert((!(std::is_same<_A1, __result_type>::value && + std::is_same<_A2, __result_type>::value)), ""); return pow((__result_type)__lcpp_x, (__result_type)__lcpp_y); } // sin -using ::sin; -using ::sinf; - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float sin(float __lcpp_x) _NOEXCEPT {return sinf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double sin(long double __lcpp_x) _NOEXCEPT {return sinl(__lcpp_x);} @@ -982,14 +894,11 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type sin(_A1 __lcpp_x) _NOEXCEPT {return sin((double)__lcpp_x);} // sinh -using ::sinh; -using ::sinhf; - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float sinh(float __lcpp_x) _NOEXCEPT {return sinhf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double sinh(long double __lcpp_x) _NOEXCEPT {return sinhl(__lcpp_x);} @@ -997,32 +906,25 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type sinh(_A1 __lcpp_x) _NOEXCEPT {return sinh((double)__lcpp_x);} // sqrt -#endif // __sun__ -using ::sqrt; -using ::sqrtf; - - -#if !(defined(_LIBCPP_MSVCRT) || defined(__sun__) || defined(_AIX)) +#if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float sqrt(float __lcpp_x) _NOEXCEPT {return sqrtf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double sqrt(long double __lcpp_x) _NOEXCEPT {return sqrtl(__lcpp_x);} #endif +#endif // __sun__ template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type sqrt(_A1 __lcpp_x) _NOEXCEPT {return sqrt((double)__lcpp_x);} +#ifndef __sun__ // tan -using ::tan; -using ::tanf; -#ifndef __sun__ - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float tan(float __lcpp_x) _NOEXCEPT {return tanf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double tan(long double __lcpp_x) _NOEXCEPT {return tanl(__lcpp_x);} @@ -1030,14 +932,11 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type tan(_A1 __lcpp_x) _NOEXCEPT {return tan((double)__lcpp_x);} // tanh -using ::tanh; -using ::tanhf; - #if !(defined(_LIBCPP_MSVCRT) || defined(_AIX)) inline _LIBCPP_INLINE_VISIBILITY float tanh(float __lcpp_x) _NOEXCEPT {return tanhf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double tanh(long double __lcpp_x) _NOEXCEPT {return tanhl(__lcpp_x);} @@ -1045,21 +944,18 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type tanh(_A1 __lcpp_x) _NOEXCEPT {return tanh((double)__lcpp_x);} // acosh #ifndef _LIBCPP_MSVCRT -using ::acosh; -using ::acoshf; - inline _LIBCPP_INLINE_VISIBILITY float acosh(float __lcpp_x) _NOEXCEPT {return acoshf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double acosh(long double __lcpp_x) _NOEXCEPT {return acoshl(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type acosh(_A1 __lcpp_x) _NOEXCEPT {return acosh((double)__lcpp_x);} #endif @@ -1066,15 +962,12 @@ // asinh #ifndef _LIBCPP_MSVCRT -using ::asinh; -using ::asinhf; - inline _LIBCPP_INLINE_VISIBILITY float asinh(float __lcpp_x) _NOEXCEPT {return asinhf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double asinh(long double __lcpp_x) _NOEXCEPT {return asinhl(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type asinh(_A1 __lcpp_x) _NOEXCEPT {return asinh((double)__lcpp_x);} #endif @@ -1081,15 +974,12 @@ // atanh #ifndef _LIBCPP_MSVCRT -using ::atanh; -using ::atanhf; - inline _LIBCPP_INLINE_VISIBILITY float atanh(float __lcpp_x) _NOEXCEPT {return atanhf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double atanh(long double __lcpp_x) _NOEXCEPT {return atanhl(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type atanh(_A1 __lcpp_x) _NOEXCEPT {return atanh((double)__lcpp_x);} #endif @@ -1096,23 +986,17 @@ // cbrt #ifndef _LIBCPP_MSVCRT -using ::cbrt; -using ::cbrtf; - inline _LIBCPP_INLINE_VISIBILITY float cbrt(float __lcpp_x) _NOEXCEPT {return cbrtf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double cbrt(long double __lcpp_x) _NOEXCEPT {return cbrtl(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type cbrt(_A1 __lcpp_x) _NOEXCEPT {return cbrt((double)__lcpp_x);} #endif // copysign -using ::copysign; -using ::copysignf; - #if !defined(_VC_CRT_MAJOR_VERSION) || (_VC_CRT_MAJOR_VERSION < 12) inline _LIBCPP_INLINE_VISIBILITY float copysign(float __lcpp_x, float __lcpp_y) _NOEXCEPT { @@ -1126,17 +1010,17 @@ template inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if +typename std::__lazy_enable_if < - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, + std::__promote<_A1, _A2> >::type copysign(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT { - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); + typedef typename std::__promote<_A1, _A2>::type __result_type; + static_assert((!(std::is_same<_A1, __result_type>::value && + std::is_same<_A2, __result_type>::value)), ""); return copysign((__result_type)__lcpp_x, (__result_type)__lcpp_y); } @@ -1144,554 +1028,391 @@ // erf -using ::erf; -using ::erff; - inline _LIBCPP_INLINE_VISIBILITY float erf(float __lcpp_x) _NOEXCEPT {return erff(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double erf(long double __lcpp_x) _NOEXCEPT {return erfl(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type erf(_A1 __lcpp_x) _NOEXCEPT {return erf((double)__lcpp_x);} // erfc -using ::erfc; -using ::erfcf; - inline _LIBCPP_INLINE_VISIBILITY float erfc(float __lcpp_x) _NOEXCEPT {return erfcf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double erfc(long double __lcpp_x) _NOEXCEPT {return erfcl(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type erfc(_A1 __lcpp_x) _NOEXCEPT {return erfc((double)__lcpp_x);} // exp2 -using ::exp2; -using ::exp2f; - inline _LIBCPP_INLINE_VISIBILITY float exp2(float __lcpp_x) _NOEXCEPT {return exp2f(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double exp2(long double __lcpp_x) _NOEXCEPT {return exp2l(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type exp2(_A1 __lcpp_x) _NOEXCEPT {return exp2((double)__lcpp_x);} // expm1 -using ::expm1; -using ::expm1f; - inline _LIBCPP_INLINE_VISIBILITY float expm1(float __lcpp_x) _NOEXCEPT {return expm1f(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double expm1(long double __lcpp_x) _NOEXCEPT {return expm1l(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type expm1(_A1 __lcpp_x) _NOEXCEPT {return expm1((double)__lcpp_x);} // fdim -using ::fdim; -using ::fdimf; - inline _LIBCPP_INLINE_VISIBILITY float fdim(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fdimf(__lcpp_x, __lcpp_y);} inline _LIBCPP_INLINE_VISIBILITY long double fdim(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fdiml(__lcpp_x, __lcpp_y);} template inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if +typename std::__lazy_enable_if < - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, + std::__promote<_A1, _A2> >::type fdim(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT { - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); + typedef typename std::__promote<_A1, _A2>::type __result_type; + static_assert((!(std::is_same<_A1, __result_type>::value && + std::is_same<_A2, __result_type>::value)), ""); return fdim((__result_type)__lcpp_x, (__result_type)__lcpp_y); } // fma -using ::fmaf; -using ::fma; - inline _LIBCPP_INLINE_VISIBILITY float fma(float __lcpp_x, float __lcpp_y, float __lcpp_z) _NOEXCEPT {return fmaf(__lcpp_x, __lcpp_y, __lcpp_z);} inline _LIBCPP_INLINE_VISIBILITY long double fma(long double __lcpp_x, long double __lcpp_y, long double __lcpp_z) _NOEXCEPT {return fmal(__lcpp_x, __lcpp_y, __lcpp_z);} template inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if +typename std::__lazy_enable_if < - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value && - is_arithmetic<_A3>::value, - __promote<_A1, _A2, _A3> + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value && + std::is_arithmetic<_A3>::value, + std::__promote<_A1, _A2, _A3> >::type fma(_A1 __lcpp_x, _A2 __lcpp_y, _A3 __lcpp_z) _NOEXCEPT { - typedef typename __promote<_A1, _A2, _A3>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value && - is_same<_A3, __result_type>::value)), ""); + typedef typename std::__promote<_A1, _A2, _A3>::type __result_type; + static_assert((!(std::is_same<_A1, __result_type>::value && + std::is_same<_A2, __result_type>::value && + std::is_same<_A3, __result_type>::value)), ""); return fma((__result_type)__lcpp_x, (__result_type)__lcpp_y, (__result_type)__lcpp_z); } // fmax -using ::fmax; -using ::fmaxf; - inline _LIBCPP_INLINE_VISIBILITY float fmax(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fmaxf(__lcpp_x, __lcpp_y);} inline _LIBCPP_INLINE_VISIBILITY long double fmax(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fmaxl(__lcpp_x, __lcpp_y);} template inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if +typename std::__lazy_enable_if < - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, + std::__promote<_A1, _A2> >::type fmax(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT { - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); + typedef typename std::__promote<_A1, _A2>::type __result_type; + static_assert((!(std::is_same<_A1, __result_type>::value && + std::is_same<_A2, __result_type>::value)), ""); return fmax((__result_type)__lcpp_x, (__result_type)__lcpp_y); } // fmin -using ::fmin; -using ::fminf; - inline _LIBCPP_INLINE_VISIBILITY float fmin(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return fminf(__lcpp_x, __lcpp_y);} inline _LIBCPP_INLINE_VISIBILITY long double fmin(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return fminl(__lcpp_x, __lcpp_y);} template inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if +typename std::__lazy_enable_if < - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, + std::__promote<_A1, _A2> >::type fmin(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT { - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); + typedef typename std::__promote<_A1, _A2>::type __result_type; + static_assert((!(std::is_same<_A1, __result_type>::value && + std::is_same<_A2, __result_type>::value)), ""); return fmin((__result_type)__lcpp_x, (__result_type)__lcpp_y); } // hypot -using ::hypot; -using ::hypotf; - inline _LIBCPP_INLINE_VISIBILITY float hypot(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return hypotf(__lcpp_x, __lcpp_y);} inline _LIBCPP_INLINE_VISIBILITY long double hypot(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return hypotl(__lcpp_x, __lcpp_y);} template inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if +typename std::__lazy_enable_if < - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, + std::__promote<_A1, _A2> >::type hypot(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT { - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); + typedef typename std::__promote<_A1, _A2>::type __result_type; + static_assert((!(std::is_same<_A1, __result_type>::value && + std::is_same<_A2, __result_type>::value)), ""); return hypot((__result_type)__lcpp_x, (__result_type)__lcpp_y); } // ilogb -using ::ilogb; -using ::ilogbf; - inline _LIBCPP_INLINE_VISIBILITY int ilogb(float __lcpp_x) _NOEXCEPT {return ilogbf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY int ilogb(long double __lcpp_x) _NOEXCEPT {return ilogbl(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, int>::type +typename std::enable_if::value, int>::type ilogb(_A1 __lcpp_x) _NOEXCEPT {return ilogb((double)__lcpp_x);} // lgamma -using ::lgamma; -using ::lgammaf; - inline _LIBCPP_INLINE_VISIBILITY float lgamma(float __lcpp_x) _NOEXCEPT {return lgammaf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double lgamma(long double __lcpp_x) _NOEXCEPT {return lgammal(__lcpp_x);} - template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type lgamma(_A1 __lcpp_x) _NOEXCEPT {return lgamma((double)__lcpp_x);} - // llrint -using ::llrint; -using ::llrintf; - inline _LIBCPP_INLINE_VISIBILITY long long llrint(float __lcpp_x) _NOEXCEPT {return llrintf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long long llrint(long double __lcpp_x) _NOEXCEPT {return llrintl(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, long long>::type +typename std::enable_if::value, long long>::type llrint(_A1 __lcpp_x) _NOEXCEPT {return llrint((double)__lcpp_x);} // llround -using ::llround; -using ::llroundf; - inline _LIBCPP_INLINE_VISIBILITY long long llround(float __lcpp_x) _NOEXCEPT {return llroundf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long long llround(long double __lcpp_x) _NOEXCEPT {return llroundl(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, long long>::type +typename std::enable_if::value, long long>::type llround(_A1 __lcpp_x) _NOEXCEPT {return llround((double)__lcpp_x);} // log1p -using ::log1p; -using ::log1pf; - inline _LIBCPP_INLINE_VISIBILITY float log1p(float __lcpp_x) _NOEXCEPT {return log1pf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double log1p(long double __lcpp_x) _NOEXCEPT {return log1pl(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type log1p(_A1 __lcpp_x) _NOEXCEPT {return log1p((double)__lcpp_x);} // log2 -using ::log2; -using ::log2f; - inline _LIBCPP_INLINE_VISIBILITY float log2(float __lcpp_x) _NOEXCEPT {return log2f(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double log2(long double __lcpp_x) _NOEXCEPT {return log2l(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type log2(_A1 __lcpp_x) _NOEXCEPT {return log2((double)__lcpp_x);} // logb -using ::logb; -using ::logbf; - inline _LIBCPP_INLINE_VISIBILITY float logb(float __lcpp_x) _NOEXCEPT {return logbf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double logb(long double __lcpp_x) _NOEXCEPT {return logbl(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type logb(_A1 __lcpp_x) _NOEXCEPT {return logb((double)__lcpp_x);} // lrint -using ::lrint; -using ::lrintf; - inline _LIBCPP_INLINE_VISIBILITY long lrint(float __lcpp_x) _NOEXCEPT {return lrintf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long lrint(long double __lcpp_x) _NOEXCEPT {return lrintl(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, long>::type +typename std::enable_if::value, long>::type lrint(_A1 __lcpp_x) _NOEXCEPT {return lrint((double)__lcpp_x);} // lround -using ::lround; -using ::lroundf; - inline _LIBCPP_INLINE_VISIBILITY long lround(float __lcpp_x) _NOEXCEPT {return lroundf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long lround(long double __lcpp_x) _NOEXCEPT {return lroundl(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, long>::type +typename std::enable_if::value, long>::type lround(_A1 __lcpp_x) _NOEXCEPT {return lround((double)__lcpp_x);} -#endif // _LIBCPP_MSVCRT -#endif // __sun__ - // nan -#ifndef _LIBCPP_MSVCRT -using ::nan; -using ::nanf; -#endif // _LIBCPP_MSVCRT - -#ifndef __sun__ -#ifndef _LIBCPP_MSVCRT - // nearbyint -using ::nearbyint; -using ::nearbyintf; - inline _LIBCPP_INLINE_VISIBILITY float nearbyint(float __lcpp_x) _NOEXCEPT {return nearbyintf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double nearbyint(long double __lcpp_x) _NOEXCEPT {return nearbyintl(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type nearbyint(_A1 __lcpp_x) _NOEXCEPT {return nearbyint((double)__lcpp_x);} // nextafter -using ::nextafter; -using ::nextafterf; - inline _LIBCPP_INLINE_VISIBILITY float nextafter(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return nextafterf(__lcpp_x, __lcpp_y);} inline _LIBCPP_INLINE_VISIBILITY long double nextafter(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nextafterl(__lcpp_x, __lcpp_y);} template inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if +typename std::__lazy_enable_if < - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, + std::__promote<_A1, _A2> >::type nextafter(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT { - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); + typedef typename std::__promote<_A1, _A2>::type __result_type; + static_assert((!(std::is_same<_A1, __result_type>::value && + std::is_same<_A2, __result_type>::value)), ""); return nextafter((__result_type)__lcpp_x, (__result_type)__lcpp_y); } // nexttoward -using ::nexttoward; -using ::nexttowardf; - inline _LIBCPP_INLINE_VISIBILITY float nexttoward(float __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttowardf(__lcpp_x, __lcpp_y);} inline _LIBCPP_INLINE_VISIBILITY long double nexttoward(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttowardl(__lcpp_x, __lcpp_y);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type nexttoward(_A1 __lcpp_x, long double __lcpp_y) _NOEXCEPT {return nexttoward((double)__lcpp_x, __lcpp_y);} // remainder -using ::remainder; -using ::remainderf; - inline _LIBCPP_INLINE_VISIBILITY float remainder(float __lcpp_x, float __lcpp_y) _NOEXCEPT {return remainderf(__lcpp_x, __lcpp_y);} inline _LIBCPP_INLINE_VISIBILITY long double remainder(long double __lcpp_x, long double __lcpp_y) _NOEXCEPT {return remainderl(__lcpp_x, __lcpp_y);} template inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if +typename std::__lazy_enable_if < - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, + std::__promote<_A1, _A2> >::type remainder(_A1 __lcpp_x, _A2 __lcpp_y) _NOEXCEPT { - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); + typedef typename std::__promote<_A1, _A2>::type __result_type; + static_assert((!(std::is_same<_A1, __result_type>::value && + std::is_same<_A2, __result_type>::value)), ""); return remainder((__result_type)__lcpp_x, (__result_type)__lcpp_y); } // remquo -using ::remquo; -using ::remquof; - inline _LIBCPP_INLINE_VISIBILITY float remquo(float __lcpp_x, float __lcpp_y, int* __lcpp_z) _NOEXCEPT {return remquof(__lcpp_x, __lcpp_y, __lcpp_z);} inline _LIBCPP_INLINE_VISIBILITY long double remquo(long double __lcpp_x, long double __lcpp_y, int* __lcpp_z) _NOEXCEPT {return remquol(__lcpp_x, __lcpp_y, __lcpp_z);} template inline _LIBCPP_INLINE_VISIBILITY -typename __lazy_enable_if +typename std::__lazy_enable_if < - is_arithmetic<_A1>::value && - is_arithmetic<_A2>::value, - __promote<_A1, _A2> + std::is_arithmetic<_A1>::value && + std::is_arithmetic<_A2>::value, + std::__promote<_A1, _A2> >::type remquo(_A1 __lcpp_x, _A2 __lcpp_y, int* __lcpp_z) _NOEXCEPT { - typedef typename __promote<_A1, _A2>::type __result_type; - static_assert((!(is_same<_A1, __result_type>::value && - is_same<_A2, __result_type>::value)), ""); + typedef typename std::__promote<_A1, _A2>::type __result_type; + static_assert((!(std::is_same<_A1, __result_type>::value && + std::is_same<_A2, __result_type>::value)), ""); return remquo((__result_type)__lcpp_x, (__result_type)__lcpp_y, __lcpp_z); } // rint -using ::rint; -using ::rintf; - inline _LIBCPP_INLINE_VISIBILITY float rint(float __lcpp_x) _NOEXCEPT {return rintf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double rint(long double __lcpp_x) _NOEXCEPT {return rintl(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type rint(_A1 __lcpp_x) _NOEXCEPT {return rint((double)__lcpp_x);} // round -using ::round; -using ::roundf; - inline _LIBCPP_INLINE_VISIBILITY float round(float __lcpp_x) _NOEXCEPT {return roundf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double round(long double __lcpp_x) _NOEXCEPT {return roundl(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type round(_A1 __lcpp_x) _NOEXCEPT {return round((double)__lcpp_x);} // scalbln -using ::scalbln; -using ::scalblnf; - inline _LIBCPP_INLINE_VISIBILITY float scalbln(float __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalblnf(__lcpp_x, __lcpp_y);} inline _LIBCPP_INLINE_VISIBILITY long double scalbln(long double __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalblnl(__lcpp_x, __lcpp_y);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type scalbln(_A1 __lcpp_x, long __lcpp_y) _NOEXCEPT {return scalbln((double)__lcpp_x, __lcpp_y);} // scalbn -using ::scalbn; -using ::scalbnf; - inline _LIBCPP_INLINE_VISIBILITY float scalbn(float __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbnf(__lcpp_x, __lcpp_y);} inline _LIBCPP_INLINE_VISIBILITY long double scalbn(long double __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbnl(__lcpp_x, __lcpp_y);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type scalbn(_A1 __lcpp_x, int __lcpp_y) _NOEXCEPT {return scalbn((double)__lcpp_x, __lcpp_y);} // tgamma -using ::tgamma; -using ::tgammaf; - inline _LIBCPP_INLINE_VISIBILITY float tgamma(float __lcpp_x) _NOEXCEPT {return tgammaf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double tgamma(long double __lcpp_x) _NOEXCEPT {return tgammal(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type tgamma(_A1 __lcpp_x) _NOEXCEPT {return tgamma((double)__lcpp_x);} // trunc -using ::trunc; -using ::truncf; - inline _LIBCPP_INLINE_VISIBILITY float trunc(float __lcpp_x) _NOEXCEPT {return truncf(__lcpp_x);} inline _LIBCPP_INLINE_VISIBILITY long double trunc(long double __lcpp_x) _NOEXCEPT {return truncl(__lcpp_x);} template inline _LIBCPP_INLINE_VISIBILITY -typename enable_if::value, double>::type +typename std::enable_if::value, double>::type trunc(_A1 __lcpp_x) _NOEXCEPT {return trunc((double)__lcpp_x);} #endif // !_LIBCPP_MSVCRT +#endif // __sun__ -using ::acosl; -using ::asinl; -using ::atanl; -using ::atan2l; -using ::ceill; -using ::cosl; -using ::coshl; -using ::expl; -using ::fabsl; -using ::floorl; -using ::fmodl; -using ::frexpl; -using ::ldexpl; -using ::logl; -using ::log10l; -using ::modfl; -using ::powl; -using ::sinl; -using ::sinhl; -using ::sqrtl; -using ::tanl; -#ifndef _LIBCPP_MSVCRT -using ::tanhl; -using ::acoshl; -using ::asinhl; -using ::atanhl; -using ::cbrtl; -#endif // !_LIBCPP_MSVCRT -using ::copysignl; -#ifndef _LIBCPP_MSVCRT -using ::erfl; -using ::erfcl; -using ::exp2l; -using ::expm1l; -using ::fdiml; -using ::fmal; -using ::fmaxl; -using ::fminl; -using ::hypotl; -using ::ilogbl; -using ::lgammal; -using ::llrintl; -using ::llroundl; -using ::log1pl; -using ::log2l; -using ::logbl; -using ::lrintl; -using ::lroundl; -using ::nanl; -using ::nearbyintl; -using ::nextafterl; -using ::nexttowardl; -using ::remainderl; -using ::remquol; -using ::rintl; -using ::roundl; -using ::scalblnl; -using ::scalbnl; -using ::tgammal; -using ::truncl; -#endif // !_LIBCPP_MSVCRT +} // extern "C++" -#else -using ::lgamma; -using ::lgammaf; -#endif // __sun__ -_LIBCPP_END_NAMESPACE_STD +#endif // __cplusplus -#endif // _LIBCPP_CMATH +#endif // _LIBCPP_MATH_H Index: include/module.modulemap =================================================================== --- include/module.modulemap +++ include/module.modulemap @@ -3,254 +3,403 @@ // re-exports its imported modules. We should provide an alternative form of // export that issues a warning if a name from the submodule is used, and // use that to provide a 'strict mode' for libc++. - module algorithm { - header "algorithm" - export initializer_list - export * - } - module array { - header "array" - export initializer_list - export * - } - module atomic { - header "atomic" - export * - requires cplusplus11 - } - module bitset { - header "bitset" - export string - export iosfwd - export * - } - // No submodule for cassert. It fundamentally needs repeated, textual inclusion. - module ccomplex { - header "ccomplex" - export complex - export * - } - module cctype { - header "cctype" - export * - } - module cerrno { - header "cerrno" + + // Deprecated C-compatibility headers. These can all be included from within + // an 'extern "C"' context. + module depr [extern_c] { + // provided by C library. + module complex_h { + header "complex.h" + export ccomplex + export * + } + module ctype_h { + header "ctype.h" + export * + } + module errno_h { + header "errno.h" + export * + } + // provided by C library. + module float_h { + header "float.h" /* - export_macros ECONNREFUSED, EIO, ENODEV, ENOTEMPTY, ERANGE, - E2BIG, ECONNRESET, EISCONN, ENOENT, ENOTRECOVERABLE, EROFS, - EACCES, EDEADLK, EISDIR, ENOEXEC, ENOTSOCK, ESPIPE, - EADDRINUSE, EDESTADDRREQ, ELOOP, ENOLCK, ENOTSUP, ESRCH, - EADDRNOTAVAIL, EDOM, EMFILE, ENOLINK, ENOTTY, ETIME, - EAFNOSUPPORT, EEXIST, EMLINK, ENOMEM, ENXIO, ETIMEDOUT, - EAGAIN, EFAULT, EMSGSIZE, ENOMSG, EOPNOTSUPP, ETXTBSY, - EALREADY, EFBIG, ENAMETOOLONG, ENOPROTOOPT, EOVERFLOW, EWOULDBLOCK, - EBADF, EHOSTUNREACH, ENETDOWN, ENOSPC, EOWNERDEAD, EXDEV, - EBADMSG, EIDRM, ENETRESET, ENOSR, EPERM, errno, - EBUSY, EILSEQ, ENETUNREACH, ENOSTR, EPIPE, - ECANCELED, EINPROGRESS, ENFILE, ENOSYS, EPROTO, - ECHILD, EINTR, ENOBUFS, ENOTCONN, EPROTONOSUPPORT, - ECONNABORTED, EINVAL, ENODATA, ENOTDIR, EPROTOTYPE + export_macros FLT_EVAL_METHOD, FLT_RADIX, FLT_ROUNDS, + FLT_DIG, FLT_EPSILON, FLT_MANT_DIG, + FLT_MAX, FLT_MAX_10_EXP, FLT_MAX_EXP, + FLT_MIN, FLT_MIN_10_EXP, FLT_MIN_EXP, + DBL_DIG, DBL_EPSILON, DBL_MANT_DIG, + DBL_MAX, DBL_MAX_10_EXP, DBL_MAX_EXP, + DBL_MIN, DBL_MIN_10_EXP, DBL_MIN_EXP, + LDBL_DIG, LDBL_EPSILON, LDBL_MANT_DIG, + LDBL_MAX, LDBL_MAX_10_EXP, LDBL_MAX_EXP, + LDBL_MIN, LDBL_MIN_10_EXP, LDBL_MIN_EXP */ - export * - } - module cfenv { - header "cfenv" + export * + } + module inttypes_h { + header "inttypes.h" + export stdint_h /* - export_macros FE_ALL_EXCEPT, FE_DIVBYZERO, FE_INEXACT, FE_INVALID, FE_OVERFLOW, - FE_UNDERFLOW, FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD, - FE_DFL_ENV + export_macros + PRId8, PRId16, PRId32, PRId64, PRIdFAST8, PRIdFAST16, PRIdFAST32, PRIdFAST64, PRIdLEAST8, PRIdLEAST16, PRIdLEAST32, PRIdLEAST64, PRIdMAX, PRIdPTR, + PRIi8, PRIi16, PRIi32, PRIi64, PRIiFAST8, PRIiFAST16, PRIiFAST32, PRIiFAST64, PRIiLEAST8, PRIiLEAST16, PRIiLEAST32, PRIiLEAST64, PRIiMAX, PRIiPTR, + PRIo8, PRIo16, PRIo32, PRIo64, PRIoFAST8, PRIoFAST16, PRIoFAST32, PRIoFAST64, PRIoLEAST8, PRIoLEAST16, PRIoLEAST32, PRIoLEAST64, PRIoMAX, PRIoPTR, + PRIu8, PRIu16, PRIu32, PRIu64, PRIuFAST8, PRIuFAST16, PRIuFAST32, PRIuFAST64, PRIuLEAST8, PRIuLEAST16, PRIuLEAST32, PRIuLEAST64, PRIuMAX, PRIuPTR, + PRIx8, PRIx16, PRIx32, PRIx64, PRIxFAST8, PRIxFAST16, PRIxFAST32, PRIxFAST64, PRIxLEAST8, PRIxLEAST16, PRIxLEAST32, PRIxLEAST64, PRIxMAX, PRIxPTR, + PRIX8, PRIX16, PRIX32, PRIX64, PRIXFAST8, PRIXFAST16, PRIXFAST32, PRIXFAST64, PRIXLEAST8, PRIXLEAST16, PRIXLEAST32, PRIXLEAST64, PRIXMAX, PRIXPTR, + SCNd8, SCNd16, SCNd32, SCNd64, SCNdFAST8, SCNdFAST16, SCNdFAST32, SCNdFAST64, SCNdLEAST8, SCNdLEAST16, SCNdLEAST32, SCNdLEAST64, SCNdMAX, SCNdPTR, + SCNi8, SCNi16, SCNi32, SCNi64, SCNiFAST8, SCNiFAST16, SCNiFAST32, SCNiFAST64, SCNiLEAST8, SCNiLEAST16, SCNiLEAST32, SCNiLEAST64, SCNiMAX, SCNiPTR, + SCNo8, SCNo16, SCNo32, SCNo64, SCNoFAST8, SCNoFAST16, SCNoFAST32, SCNoFAST64, SCNoLEAST8, SCNoLEAST16, SCNoLEAST32, SCNoLEAST64, SCNoMAX, SCNoPTR, + SCNu8, SCNu16, SCNu32, SCNu64, SCNuFAST8, SCNuFAST16, SCNuFAST32, SCNuFAST64, SCNuLEAST8, SCNuLEAST16, SCNuLEAST32, SCNuLEAST64, SCNuMAX, SCNuPTR, + SCNx8, SCNx16, SCNx32, SCNx64, SCNxFAST8, SCNxFAST16, SCNxFAST32, SCNxFAST64, SCNxLEAST8, SCNxLEAST16, SCNxLEAST32, SCNxLEAST64, SCNxMAX, SCNxPTR, + SCNX8, SCNX16, SCNX32, SCNX64, SCNXFAST8, SCNXFAST16, SCNXFAST32, SCNXFAST64, SCNXLEAST8, SCNXLEAST16, SCNXLEAST32, SCNXLEAST64, SCNXMAX, SCNXPTR */ - export * - } - module cfloat { - header "cfloat" + export * + } + // provided by compiler. + // provided by compiler or C library. + module locale_h { + header "locale.h" /* - export_macros FLT_EVAL_METHOD, FLT_RADIX, FLT_ROUNDS, - FLT_DIG, FLT_EPSILON, FLT_MANT_DIG, - FLT_MAX, FLT_MAX_10_EXP, FLT_MAX_EXP, - FLT_MIN, FLT_MIN_10_EXP, FLT_MIN_EXP, - DBL_DIG, DBL_EPSILON, DBL_MANT_DIG, - DBL_MAX, DBL_MAX_10_EXP, DBL_MAX_EXP, - DBL_MIN, DBL_MIN_10_EXP, DBL_MIN_EXP, - LDBL_DIG, LDBL_EPSILON, LDBL_MANT_DIG, - LDBL_MAX, LDBL_MAX_10_EXP, LDBL_MAX_EXP, - LDBL_MIN, LDBL_MIN_10_EXP, LDBL_MIN_EXP + export_macros LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME, NULL */ - export * - } - module chrono { - header "chrono" - export * - } - module cinttypes { - header "cinttypes" - export cstdint + export * + } + module math_h { + header "math.h" /* - export_macros - PRId8, PRId16, PRId32, PRId64, PRIdFAST8, PRIdFAST16, PRIdFAST32, PRIdFAST64, PRIdLEAST8, PRIdLEAST16, PRIdLEAST32, PRIdLEAST64, PRIdMAX, PRIdPTR, - PRIi8, PRIi16, PRIi32, PRIi64, PRIiFAST8, PRIiFAST16, PRIiFAST32, PRIiFAST64, PRIiLEAST8, PRIiLEAST16, PRIiLEAST32, PRIiLEAST64, PRIiMAX, PRIiPTR, - PRIo8, PRIo16, PRIo32, PRIo64, PRIoFAST8, PRIoFAST16, PRIoFAST32, PRIoFAST64, PRIoLEAST8, PRIoLEAST16, PRIoLEAST32, PRIoLEAST64, PRIoMAX, PRIoPTR, - PRIu8, PRIu16, PRIu32, PRIu64, PRIuFAST8, PRIuFAST16, PRIuFAST32, PRIuFAST64, PRIuLEAST8, PRIuLEAST16, PRIuLEAST32, PRIuLEAST64, PRIuMAX, PRIuPTR, - PRIx8, PRIx16, PRIx32, PRIx64, PRIxFAST8, PRIxFAST16, PRIxFAST32, PRIxFAST64, PRIxLEAST8, PRIxLEAST16, PRIxLEAST32, PRIxLEAST64, PRIxMAX, PRIxPTR, - PRIX8, PRIX16, PRIX32, PRIX64, PRIXFAST8, PRIXFAST16, PRIXFAST32, PRIXFAST64, PRIXLEAST8, PRIXLEAST16, PRIXLEAST32, PRIXLEAST64, PRIXMAX, PRIXPTR, - SCNd8, SCNd16, SCNd32, SCNd64, SCNdFAST8, SCNdFAST16, SCNdFAST32, SCNdFAST64, SCNdLEAST8, SCNdLEAST16, SCNdLEAST32, SCNdLEAST64, SCNdMAX, SCNdPTR, - SCNi8, SCNi16, SCNi32, SCNi64, SCNiFAST8, SCNiFAST16, SCNiFAST32, SCNiFAST64, SCNiLEAST8, SCNiLEAST16, SCNiLEAST32, SCNiLEAST64, SCNiMAX, SCNiPTR, - SCNo8, SCNo16, SCNo32, SCNo64, SCNoFAST8, SCNoFAST16, SCNoFAST32, SCNoFAST64, SCNoLEAST8, SCNoLEAST16, SCNoLEAST32, SCNoLEAST64, SCNoMAX, SCNoPTR, - SCNu8, SCNu16, SCNu32, SCNu64, SCNuFAST8, SCNuFAST16, SCNuFAST32, SCNuFAST64, SCNuLEAST8, SCNuLEAST16, SCNuLEAST32, SCNuLEAST64, SCNuMAX, SCNuPTR, - SCNx8, SCNx16, SCNx32, SCNx64, SCNxFAST8, SCNxFAST16, SCNxFAST32, SCNxFAST64, SCNxLEAST8, SCNxLEAST16, SCNxLEAST32, SCNxLEAST64, SCNxMAX, SCNxPTR, - SCNX8, SCNX16, SCNX32, SCNX64, SCNXFAST8, SCNXFAST16, SCNXFAST32, SCNXFAST64, SCNXLEAST8, SCNXLEAST16, SCNXLEAST32, SCNXLEAST64, SCNXMAX, SCNXPTR + export_macros FP_FAST_FMA, FP_FAST_FMAF, FP_FAST_FMAL, FP_ILOGBO, FP_ILOGBNAN, + FP_INFINITE, FP_NAN, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, + HUGE_VAL, HUGE_VALF, HUGE_VALL, INFINITY, NAN, + MATH_ERRNO, MATH_ERREXCEPT, math_errhandling */ - export * - } - module ciso646 { - header "ciso646" - export * - } - module climits { - header "climits" + export * + } + module setjmp_h { + header "setjmp.h" /* - export_macros CHAR_BIT, CHAR_MIN, CHAR_MAX, - SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, - SHRT_MIN, SHRT_MAX, USHRT_MAX, - INT_MIN, INT_MAX, UINT_MAX, - LONG_MIN, LONG_MAX, ULONG_MAX, - LLONG_MIN, LLONG_MAX, ULLONG_MAX, - MB_LEN_MAX + export_macros setjmp */ - export * - } - module clocale { - header "clocale" + export * + } + // FIXME: is missing. + // provided by C library. + // provided by compiler. + // provided by compiler. + module stddef_h { + // 's __need_* macros require textual inclusion. + textual header "stddef.h" + } + // provided by compiler or C library. + module stdio_h { + // 's __need_* macros require textual inclusion. + textual header "stdio.h" /* - export_macros LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME, NULL + export_macros BUFSIZ, EOF, FILENAME_MAX, FOPEN_MAX, L_tmpnam, NULL, + SEEK_CUR, SEEK_END, SEEK_SET, TMP_MAX, _IOFBF, _IOLBF, + stdin, stdout, stderr */ - export * - } - module cmath { - header "cmath" + export * + } + module stdlib_h { + // 's __need_* macros require textual inclusion. + textual header "stdlib.h" /* - export_macros FP_FAST_FMA, FP_FAST_FMAF, FP_FAST_FMAL, FP_ILOGBO, FP_ILOGBNAN, - FP_INFINITE, FP_NAN, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, - HUGE_VAL, HUGE_VALF, HUGE_VALL, INFINITY, NAN, - MATH_ERRNO, MATH_ERREXCEPT, math_errhandling + export_macros RAND_MAX */ - export * - } - module codecvt { - header "codecvt" - export * - } - module complex { - header "complex" - export * - } - module condition_variable { - header "condition_variable" - export * - } - module csetjmp { - header "csetjmp" + export * + } + module string_h { + header "string.h" /* - export_macros setjmp + export_macros NULL */ - export * - } - module csignal { - header "csignal" + export * + } + module tgmath { + header "tgmath.h" + export ccomplex + export cmath + export * + } + // FIXME: is missing. + // provided by C library. + module wchar_h { + // 's __need_* macros require textual inclusion. + textual header "wchar.h" /* - export_macros SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, SIGTERM, - SIG_DFL, SIG_IGN, SIG_ERR + export_macros NULL, WCHAR_MAX, WCHAR_MIN, WEOF */ - export * - } - module cstdarg { - header "cstdarg" + export * + } + module wctype_h { + header "wctype.h" /* - export_macros va_arg, va_start, va_end, va_copy + export_macros WEOF */ - export * + export * + } } - module cstdbool { - header "cstdbool" + + // C compatibility headers. + module compat { + module cassert { + // 's use of NDEBUG requires textual inclusion. + textual header "cassert" + } + module ccomplex { + header "ccomplex" + export complex + export * + } + module cctype { + header "cctype" + export * + } + module cerrno { + header "cerrno" /* - export_macros __bool_true_false_are_defined + export_macros ECONNREFUSED, EIO, ENODEV, ENOTEMPTY, ERANGE, + E2BIG, ECONNRESET, EISCONN, ENOENT, ENOTRECOVERABLE, EROFS, + EACCES, EDEADLK, EISDIR, ENOEXEC, ENOTSOCK, ESPIPE, + EADDRINUSE, EDESTADDRREQ, ELOOP, ENOLCK, ENOTSUP, ESRCH, + EADDRNOTAVAIL, EDOM, EMFILE, ENOLINK, ENOTTY, ETIME, + EAFNOSUPPORT, EEXIST, EMLINK, ENOMEM, ENXIO, ETIMEDOUT, + EAGAIN, EFAULT, EMSGSIZE, ENOMSG, EOPNOTSUPP, ETXTBSY, + EALREADY, EFBIG, ENAMETOOLONG, ENOPROTOOPT, EOVERFLOW, EWOULDBLOCK, + EBADF, EHOSTUNREACH, ENETDOWN, ENOSPC, EOWNERDEAD, EXDEV, + EBADMSG, EIDRM, ENETRESET, ENOSR, EPERM, errno, + EBUSY, EILSEQ, ENETUNREACH, ENOSTR, EPIPE, + ECANCELED, EINPROGRESS, ENFILE, ENOSYS, EPROTO, + ECHILD, EINTR, ENOBUFS, ENOTCONN, EPROTONOSUPPORT, + ECONNABORTED, EINVAL, ENODATA, ENOTDIR, EPROTOTYPE */ - export * - } - module cstddef { - header "cstddef" + export * + } + module cfenv { + header "cfenv" /* - export_macros NULL, offsetof + export_macros FE_ALL_EXCEPT, FE_DIVBYZERO, FE_INEXACT, FE_INVALID, FE_OVERFLOW, + FE_UNDERFLOW, FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD, + FE_DFL_ENV */ - export * - } - module cstdint { - header "cstdint" + export * + } + module cfloat { + header "cfloat" /* - export_macros - INT_8_MIN, INT_8_MAX, UINT_8_MAX, INT_16_MIN, INT_16_MAX, UINT_16_MAX, - INT_32_MIN, INT_32_MAX, UINT_32_MAX, INT_64_MIN, INT_64_MAX, UINT_64_MAX, - INT_FAST8_MIN, INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX, UINT_FAST16_MAX, - INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX, INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, - INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX, INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX, - INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, - INT_MAX_MIN, INT_MAX_MAX, UINT_MAX_MAX, INT_PTR_MIN, INT_PTR_MAX, UINT_PTR_MAX, - PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX, - SIZE_MAX + export_macros FLT_EVAL_METHOD, FLT_RADIX, FLT_ROUNDS, + FLT_DIG, FLT_EPSILON, FLT_MANT_DIG, + FLT_MAX, FLT_MAX_10_EXP, FLT_MAX_EXP, + FLT_MIN, FLT_MIN_10_EXP, FLT_MIN_EXP, + DBL_DIG, DBL_EPSILON, DBL_MANT_DIG, + DBL_MAX, DBL_MAX_10_EXP, DBL_MAX_EXP, + DBL_MIN, DBL_MIN_10_EXP, DBL_MIN_EXP, + LDBL_DIG, LDBL_EPSILON, LDBL_MANT_DIG, + LDBL_MAX, LDBL_MAX_10_EXP, LDBL_MAX_EXP, + LDBL_MIN, LDBL_MIN_10_EXP, LDBL_MIN_EXP */ - export * - } - module cstdio { - header "cstdio" + export * + } + module cinttypes { + header "cinttypes" + export cstdint /* - export_macros BUFSIZ, EOF, FILENAME_MAX, FOPEN_MAX, L_tmpnam, NULL, - SEEK_CUR, SEEK_END, SEEK_SET, TMP_MAX, _IOFBF, _IOLBF, - stdin, stdout, stderr + export_macros + PRId8, PRId16, PRId32, PRId64, PRIdFAST8, PRIdFAST16, PRIdFAST32, PRIdFAST64, PRIdLEAST8, PRIdLEAST16, PRIdLEAST32, PRIdLEAST64, PRIdMAX, PRIdPTR, + PRIi8, PRIi16, PRIi32, PRIi64, PRIiFAST8, PRIiFAST16, PRIiFAST32, PRIiFAST64, PRIiLEAST8, PRIiLEAST16, PRIiLEAST32, PRIiLEAST64, PRIiMAX, PRIiPTR, + PRIo8, PRIo16, PRIo32, PRIo64, PRIoFAST8, PRIoFAST16, PRIoFAST32, PRIoFAST64, PRIoLEAST8, PRIoLEAST16, PRIoLEAST32, PRIoLEAST64, PRIoMAX, PRIoPTR, + PRIu8, PRIu16, PRIu32, PRIu64, PRIuFAST8, PRIuFAST16, PRIuFAST32, PRIuFAST64, PRIuLEAST8, PRIuLEAST16, PRIuLEAST32, PRIuLEAST64, PRIuMAX, PRIuPTR, + PRIx8, PRIx16, PRIx32, PRIx64, PRIxFAST8, PRIxFAST16, PRIxFAST32, PRIxFAST64, PRIxLEAST8, PRIxLEAST16, PRIxLEAST32, PRIxLEAST64, PRIxMAX, PRIxPTR, + PRIX8, PRIX16, PRIX32, PRIX64, PRIXFAST8, PRIXFAST16, PRIXFAST32, PRIXFAST64, PRIXLEAST8, PRIXLEAST16, PRIXLEAST32, PRIXLEAST64, PRIXMAX, PRIXPTR, + SCNd8, SCNd16, SCNd32, SCNd64, SCNdFAST8, SCNdFAST16, SCNdFAST32, SCNdFAST64, SCNdLEAST8, SCNdLEAST16, SCNdLEAST32, SCNdLEAST64, SCNdMAX, SCNdPTR, + SCNi8, SCNi16, SCNi32, SCNi64, SCNiFAST8, SCNiFAST16, SCNiFAST32, SCNiFAST64, SCNiLEAST8, SCNiLEAST16, SCNiLEAST32, SCNiLEAST64, SCNiMAX, SCNiPTR, + SCNo8, SCNo16, SCNo32, SCNo64, SCNoFAST8, SCNoFAST16, SCNoFAST32, SCNoFAST64, SCNoLEAST8, SCNoLEAST16, SCNoLEAST32, SCNoLEAST64, SCNoMAX, SCNoPTR, + SCNu8, SCNu16, SCNu32, SCNu64, SCNuFAST8, SCNuFAST16, SCNuFAST32, SCNuFAST64, SCNuLEAST8, SCNuLEAST16, SCNuLEAST32, SCNuLEAST64, SCNuMAX, SCNuPTR, + SCNx8, SCNx16, SCNx32, SCNx64, SCNxFAST8, SCNxFAST16, SCNxFAST32, SCNxFAST64, SCNxLEAST8, SCNxLEAST16, SCNxLEAST32, SCNxLEAST64, SCNxMAX, SCNxPTR, + SCNX8, SCNX16, SCNX32, SCNX64, SCNXFAST8, SCNXFAST16, SCNXFAST32, SCNXFAST64, SCNXLEAST8, SCNXLEAST16, SCNXLEAST32, SCNXLEAST64, SCNXMAX, SCNXPTR */ - export * - } - module cstdlib { - header "cstdlib" + export * + } + module ciso646 { + header "ciso646" + export * + } + module climits { + header "climits" /* - export_macros RAND_MAX + export_macros CHAR_BIT, CHAR_MIN, CHAR_MAX, + SCHAR_MIN, SCHAR_MAX, UCHAR_MAX, + SHRT_MIN, SHRT_MAX, USHRT_MAX, + INT_MIN, INT_MAX, UINT_MAX, + LONG_MIN, LONG_MAX, ULONG_MAX, + LLONG_MIN, LLONG_MAX, ULLONG_MAX, + MB_LEN_MAX */ - export * - } - module cstring { - header "cstring" + export * + } + module clocale { + header "clocale" /* - export_macros NULL + export_macros LC_ALL, LC_COLLATE, LC_CTYPE, LC_MONETARY, LC_NUMERIC, LC_TIME, NULL */ + export * + } + module cmath { + header "cmath" +/* + export_macros FP_FAST_FMA, FP_FAST_FMAF, FP_FAST_FMAL, FP_ILOGBO, FP_ILOGBNAN, + FP_INFINITE, FP_NAN, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, + HUGE_VAL, HUGE_VALF, HUGE_VALL, INFINITY, NAN, + MATH_ERRNO, MATH_ERREXCEPT, math_errhandling +*/ + export * + } + module csetjmp { + header "csetjmp" +/* + export_macros setjmp +*/ + export * + } + module csignal { + header "csignal" +/* + export_macros SIGABRT, SIGFPE, SIGILL, SIGINT, SIGSEGV, SIGTERM, + SIG_DFL, SIG_IGN, SIG_ERR +*/ + export * + } + // FIXME: is missing. + module cstdarg { + header "cstdarg" +/* + export_macros va_arg, va_start, va_end, va_copy +*/ + export * + } + module cstdbool { + header "cstdbool" +/* + export_macros __bool_true_false_are_defined +*/ + export * + } + module cstddef { + header "cstddef" +/* + export_macros NULL, offsetof +*/ + export * + } + module cstdint { + header "cstdint" +/* + export_macros + INT_8_MIN, INT_8_MAX, UINT_8_MAX, INT_16_MIN, INT_16_MAX, UINT_16_MAX, + INT_32_MIN, INT_32_MAX, UINT_32_MAX, INT_64_MIN, INT_64_MAX, UINT_64_MAX, + INT_FAST8_MIN, INT_FAST8_MAX, UINT_FAST8_MAX, INT_FAST16_MIN, INT_FAST16_MAX, UINT_FAST16_MAX, + INT_FAST32_MIN, INT_FAST32_MAX, UINT_FAST32_MAX, INT_FAST64_MIN, INT_FAST64_MAX, UINT_FAST64_MAX, + INT_LEAST8_MIN, INT_LEAST8_MAX, UINT_LEAST8_MAX, INT_LEAST16_MIN, INT_LEAST16_MAX, UINT_LEAST16_MAX, + INT_LEAST32_MIN, INT_LEAST32_MAX, UINT_LEAST32_MAX, INT_LEAST64_MIN, INT_LEAST64_MAX, UINT_LEAST64_MAX, + INT_MAX_MIN, INT_MAX_MAX, UINT_MAX_MAX, INT_PTR_MIN, INT_PTR_MAX, UINT_PTR_MAX, + PTRDIFF_MIN, PTRDIFF_MAX, SIG_ATOMIC_MIN, SIG_ATOMIC_MAX, WCHAR_MIN, WCHAR_MAX, WINT_MIN, WINT_MAX, + SIZE_MAX +*/ + export * + } + module cstdio { + header "cstdio" +/* + export_macros BUFSIZ, EOF, FILENAME_MAX, FOPEN_MAX, L_tmpnam, NULL, + SEEK_CUR, SEEK_END, SEEK_SET, TMP_MAX, _IOFBF, _IOLBF, + stdin, stdout, stderr +*/ + export * + } + module cstdlib { + header "cstdlib" +/* + export_macros RAND_MAX +*/ + export * + } + module cstring { + header "cstring" +/* + export_macros NULL +*/ + export * + } + module ctgmath { + header "ctgmath" + export ccomplex + export cmath + export * + } + module ctime { + header "ctime" +/* + export_macros NULL, CLOCKS_PER_SEC +*/ + export * + } + // FIXME: is missing. + module cwchar { + header "cwchar" +/* + export_macros NULL, WCHAR_MAX, WCHAR_MIN, WEOF +*/ + export * + } + module cwctype { + header "cwctype" +/* + export_macros WEOF +*/ + export * + } + } + + module algorithm { + header "algorithm" + export initializer_list export * } - module ctgmath { - header "ctgmath" - export ccomplex - export cmath + module array { + header "array" + export initializer_list export * } - module ctime { - header "ctime" -/* - export_macros NULL, CLOCKS_PER_SEC -*/ + module atomic { + header "atomic" export * + requires cplusplus11 } - module cwchar { - header "cwchar" -/* - export_macros NULL, WCHAR_MAX, WCHAR_MIN, WEOF -*/ + module bitset { + header "bitset" + export string + export iosfwd export * } - module cwctype { - header "cwctype" -/* - export_macros WEOF -*/ + module chrono { + header "chrono" export * } + module codecvt { + header "codecvt" + export * + } + module complex { + header "complex" + export * + } + module condition_variable { + header "condition_variable" + export * + } module deque { header "deque" export initializer_list @@ -463,6 +612,7 @@ module __hash_table { header "__hash_table" export * } module __locale { header "__locale" export * } module __mutex_base { header "__mutex_base" export * } + module __nullptr { header "__nullptr" export * } module __split_buffer { header "__split_buffer" export * } module __sso_allocator { header "__sso_allocator" export * } module __std_stream { header "__std_stream" export * } Index: include/setjmp.h =================================================================== --- include/setjmp.h +++ include/setjmp.h @@ -1,5 +1,5 @@ // -*- C++ -*- -//===--------------------------- csetjmp ----------------------------------===// +//===--------------------------- setjmp.h ---------------------------------===// // // The LLVM Compiler Infrastructure // @@ -8,19 +8,16 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_CSETJMP -#define _LIBCPP_CSETJMP +#ifndef _LIBCPP_SETJMP_H +#define _LIBCPP_SETJMP_H /* - csetjmp synopsis + setjmp.h synopsis Macros: setjmp -namespace std -{ - Types: jmp_buf @@ -27,12 +24,10 @@ void longjmp(jmp_buf env, int val); -} // std - */ #include <__config> -#include +#include_next #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header @@ -42,11 +37,4 @@ #define setjmp(env) setjmp(env) #endif -_LIBCPP_BEGIN_NAMESPACE_STD - -using ::jmp_buf; -using ::longjmp; - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP_CSETJMP +#endif // _LIBCPP_SETJMP_H Index: include/stddef.h =================================================================== --- include/stddef.h +++ include/stddef.h @@ -1,5 +1,5 @@ // -*- C++ -*- -//===--------------------------- cstddef ----------------------------------===// +//===--------------------------- stddef.h ---------------------------------===// // // The LLVM Compiler Infrastructure // @@ -8,11 +8,15 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_CSTDDEF -#define _LIBCPP_CSTDDEF +#if defined(__need_ptrdiff_t) || defined(__need_size_t) || \ + defined(__need_wchar_t) || defined(__need_NULL) || defined(__need_wint_t) +#include_next +#elif !defined(_LIBCPP_STDDEF_H) +#define _LIBCPP_STDDEF_H + /* - cstddef synopsis + stddef.h synopsis Macros: @@ -19,9 +23,6 @@ offsetof(type,member-designator) NULL -namespace std -{ - Types: ptrdiff_t @@ -29,74 +30,27 @@ max_align_t nullptr_t -} // std - */ #include <__config> +#include_next -#include - #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif -_LIBCPP_BEGIN_NAMESPACE_STD +#ifdef __cplusplus -using ::ptrdiff_t; -using ::size_t; +extern "C++" { +#include <__nullptr> +using std::nullptr_t; +} -#if defined(__CLANG_MAX_ALIGN_T_DEFINED) || defined(_GCC_MAX_ALIGN_T) // Re-use the compiler's max_align_t where possible. -using ::max_align_t; -#else +#if !defined(__CLANG_MAX_ALIGN_T_DEFINED) && !defined(_GCC_MAX_ALIGN_T) typedef long double max_align_t; #endif -#ifdef _LIBCPP_HAS_NO_NULLPTR +#endif -struct _LIBCPP_TYPE_VIS_ONLY nullptr_t -{ - void* __lx; - - struct __nat {int __for_bool_;}; - - _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t() : __lx(0) {} - _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t(int __nat::*) : __lx(0) {} - - _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR operator int __nat::*() const {return 0;} - - template - _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR - operator _Tp* () const {return 0;} - - template - _LIBCPP_ALWAYS_INLINE - operator _Tp _Up::* () const {return 0;} - - friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator==(nullptr_t, nullptr_t) {return true;} - friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator!=(nullptr_t, nullptr_t) {return false;} - friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator<(nullptr_t, nullptr_t) {return false;} - friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator<=(nullptr_t, nullptr_t) {return true;} - friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator>(nullptr_t, nullptr_t) {return false;} - friend _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR bool operator>=(nullptr_t, nullptr_t) {return true;} -}; - -inline _LIBCPP_ALWAYS_INLINE _LIBCPP_CONSTEXPR nullptr_t __get_nullptr_t() {return nullptr_t(0);} - -#define nullptr _VSTD::__get_nullptr_t() - -#endif // _LIBCPP_HAS_NO_NULLPTR - -_LIBCPP_END_NAMESPACE_STD - -#ifndef _LIBCPP_HAS_NO_NULLPTR - -namespace std -{ - typedef decltype(nullptr) nullptr_t; -} - -#endif // _LIBCPP_HAS_NO_NULLPTR - -#endif // _LIBCPP_CSTDDEF +#endif // _LIBCPP_STDDEF_H Index: include/stdio.h =================================================================== --- include/stdio.h +++ include/stdio.h @@ -1,5 +1,5 @@ // -*- C++ -*- -//===---------------------------- cstdio ----------------------------------===// +//===---------------------------- stdio.h ---------------------------------===// // // The LLVM Compiler Infrastructure // @@ -8,11 +8,14 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_CSTDIO -#define _LIBCPP_CSTDIO +#if defined(__need_FILE) || defined(__need___FILE) +#include_next +#elif !defined(_LIBCPP_STDIO_H) +#define _LIBCPP_STDIO_H + /* - cstdio synopsis + stdio.h synopsis Macros: @@ -33,9 +36,6 @@ stdin stdout -namespace std -{ - Types: FILE @@ -92,118 +92,30 @@ int feof(FILE* stream); int ferror(FILE* stream); void perror(const char* s); - -} // std */ #include <__config> -#include +#include_next #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif +#ifdef __cplusplus + // snprintf #if defined(_LIBCPP_MSVCRT) +extern "C++" { #include "support/win32/support.h" +} #endif -#ifdef getc -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_getc(FILE* __stream) {return getc(__stream);} #undef getc -inline _LIBCPP_INLINE_VISIBILITY int getc(FILE* __stream) {return __libcpp_getc(__stream);} -#endif // getc - -#ifdef putc -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_putc(int __c, FILE* __stream) {return putc(__c, __stream);} #undef putc -inline _LIBCPP_INLINE_VISIBILITY int putc(int __c, FILE* __stream) {return __libcpp_putc(__c, __stream);} -#endif // putc - -#ifdef clearerr -inline _LIBCPP_INLINE_VISIBILITY void __libcpp_clearerr(FILE* __stream) { return clearerr(__stream); } #undef clearerr -inline _LIBCPP_INLINE_VISIBILITY void clearerr(FILE* __stream) { return __libcpp_clearerr(__stream); } -#endif // clearerr - -#ifdef feof -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_feof(FILE* __stream) { return feof(__stream); } #undef feof -inline _LIBCPP_INLINE_VISIBILITY int feof(FILE* __stream) { return __libcpp_feof(__stream); } -#endif // feof - -#ifdef ferror -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_ferror(FILE* __stream) { return ferror(__stream); } #undef ferror -inline _LIBCPP_INLINE_VISIBILITY int ferror(FILE* __stream) { return __libcpp_ferror(__stream); } -#endif // ferror -_LIBCPP_BEGIN_NAMESPACE_STD - -using ::FILE; -using ::fpos_t; -using ::size_t; - -using ::fclose; -using ::fflush; -using ::setbuf; -using ::setvbuf; -using ::fprintf; -using ::fscanf; -using ::snprintf; -using ::sprintf; -using ::sscanf; -#ifndef _LIBCPP_MSVCRT -using ::vfprintf; -using ::vfscanf; -using ::vsscanf; -#endif // _LIBCPP_MSVCRT -using ::vsnprintf; -using ::vsprintf; -using ::fgetc; -using ::fgets; -using ::fputc; -using ::fputs; -using ::getc; -using ::putc; -using ::ungetc; -using ::fread; -using ::fwrite; -using ::fgetpos; -using ::fseek; -using ::fsetpos; -using ::ftell; -using ::rewind; -using ::clearerr; -using ::feof; -using ::ferror; -using ::perror; - -#ifndef _LIBCPP_HAS_NO_GLOBAL_FILESYSTEM_NAMESPACE -using ::fopen; -using ::freopen; -using ::remove; -using ::rename; -using ::tmpfile; -using ::tmpnam; #endif -#ifndef _LIBCPP_HAS_NO_STDIN -using ::getchar; -#if _LIBCPP_STD_VER <= 11 -using ::gets; -#endif -using ::scanf; -using ::vscanf; -#endif - -#ifndef _LIBCPP_HAS_NO_STDOUT -using ::printf; -using ::putchar; -using ::puts; -using ::vprintf; -#endif - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP_CSTDIO +#endif // _LIBCPP_STDIO_H Index: include/stdlib.h =================================================================== --- include/stdlib.h +++ include/stdlib.h @@ -1,5 +1,5 @@ // -*- C++ -*- -//===--------------------------- cstdlib ----------------------------------===// +//===--------------------------- stdlib.h ---------------------------------===// // // The LLVM Compiler Infrastructure // @@ -8,11 +8,14 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_CSTDLIB -#define _LIBCPP_CSTDLIB +#if defined(__need_malloc_and_calloc) +#include_next +#elif !defined(_LIBCPP_STDLIB_H) +#define _LIBCPP_STDLIB_H + /* - cstdlib synopsis + stdlib.h synopsis Macros: @@ -22,9 +25,6 @@ NULL RAND_MAX -namespace std -{ - Types: size_t @@ -78,89 +78,30 @@ void quick_exit(int status); // C++11 void *aligned_alloc(size_t alignment, size_t size); // C11 -} // std - */ #include <__config> -#include -#ifdef _LIBCPP_MSVCRT -#include "support/win32/locale_win32.h" -#endif // _LIBCPP_MSVCRT +#include_next #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif -_LIBCPP_BEGIN_NAMESPACE_STD +#ifdef __cplusplus +extern "C++" { -using ::size_t; -using ::div_t; -using ::ldiv_t; -#ifndef _LIBCPP_HAS_NO_LONG_LONG -using ::lldiv_t; -#endif // _LIBCPP_HAS_NO_LONG_LONG -using ::atof; -using ::atoi; -using ::atol; -#ifndef _LIBCPP_HAS_NO_LONG_LONG -using ::atoll; -#endif // _LIBCPP_HAS_NO_LONG_LONG -using ::strtod; -using ::strtof; -using ::strtold; -using ::strtol; -#ifndef _LIBCPP_HAS_NO_LONG_LONG -using ::strtoll; -#endif // _LIBCPP_HAS_NO_LONG_LONG -using ::strtoul; -#ifndef _LIBCPP_HAS_NO_LONG_LONG -using ::strtoull; -#endif // _LIBCPP_HAS_NO_LONG_LONG -using ::rand; -using ::srand; -using ::calloc; -using ::free; -using ::malloc; -using ::realloc; -using ::abort; -using ::atexit; -using ::exit; -using ::_Exit; -using ::getenv; -using ::system; -using ::bsearch; -using ::qsort; +#ifdef _LIBCPP_MSVCRT +#include "support/win32/locale_win32.h" +#endif // _LIBCPP_MSVCRT + #undef abs -using ::abs; +#undef div #undef labs -using ::labs; +#undef ldiv #ifndef _LIBCPP_HAS_NO_LONG_LONG #undef llabs -using ::llabs; -#endif // _LIBCPP_HAS_NO_LONG_LONG -#undef div -using ::div; -#undef ldiv -using ::ldiv; -#ifndef _LIBCPP_HAS_NO_LONG_LONG #undef lldiv -using ::lldiv; -#endif // _LIBCPP_HAS_NO_LONG_LONG -#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS -using ::mblen; -using ::mbtowc; -using ::wctomb; #endif -using ::mbstowcs; -using ::wcstombs; -#ifdef _LIBCPP_HAS_QUICK_EXIT -using ::at_quick_exit; -using ::quick_exit; -#endif -#ifdef _LIBCPP_HAS_C11_FEATURES -using ::aligned_alloc; -#endif // MSVCRT already has the correct prototype in #ifdef __cplusplus #if !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_AIX) @@ -173,8 +114,9 @@ #ifndef _LIBCPP_HAS_NO_LONG_LONG inline _LIBCPP_INLINE_VISIBILITY lldiv_t div(long long __x, long long __y) _NOEXCEPT {return lldiv(__x, __y);} #endif // _LIBCPP_HAS_NO_LONG_LONG -#endif // _LIBCPP_MSVCRT +#endif // _LIBCPP_MSVCRT / __sun__ / _AIX -_LIBCPP_END_NAMESPACE_STD +} // extern "C++" +#endif // __cplusplus -#endif // _LIBCPP_CSTDLIB +#endif // _LIBCPP_STDLIB_H Index: include/string.h =================================================================== --- include/string.h +++ include/string.h @@ -1,5 +1,5 @@ // -*- C++ -*- -//===--------------------------- cstring ----------------------------------===// +//===--------------------------- string.h ---------------------------------===// // // The LLVM Compiler Infrastructure // @@ -8,19 +8,16 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_CSTRING -#define _LIBCPP_CSTRING +#ifndef _LIBCPP_STRING_H +#define _LIBCPP_STRING_H /* - cstring synopsis + string.h synopsis Macros: NULL -namespace std -{ - Types: size_t @@ -53,62 +50,28 @@ char* strerror(int errnum); size_t strlen(const char* s); -} // std - */ #include <__config> -#include +#include_next #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif -_LIBCPP_BEGIN_NAMESPACE_STD +#ifdef __cplusplus +extern "C++" { -using ::size_t; -using ::memcpy; -using ::memmove; -using ::strcpy; -using ::strncpy; -using ::strcat; -using ::strncat; -using ::memcmp; -using ::strcmp; -using ::strncmp; -using ::strcoll; -using ::strxfrm; - -using ::memchr; - -using ::strchr; - -using ::strcspn; - -using ::strpbrk; - -using ::strrchr; - -using ::strspn; - -using ::strstr; - // MSVCRT, GNU libc and its derivates already have the correct prototype in #ifdef __cplusplus #if !defined(__GLIBC__) && !defined(_LIBCPP_MSVCRT) && !defined(__sun__) && !defined(_STRING_H_CPLUSPLUS_98_CONFORMANCE_) -inline _LIBCPP_INLINE_VISIBILITY char* strchr( char* __s, int __c) {return ::strchr(__s, __c);} -inline _LIBCPP_INLINE_VISIBILITY char* strpbrk( char* __s1, const char* __s2) {return ::strpbrk(__s1, __s2);} -inline _LIBCPP_INLINE_VISIBILITY char* strrchr( char* __s, int __c) {return ::strrchr(__s, __c);} -inline _LIBCPP_INLINE_VISIBILITY void* memchr( void* __s, int __c, size_t __n) {return ::memchr(__s, __c, __n);} -inline _LIBCPP_INLINE_VISIBILITY char* strstr( char* __s1, const char* __s2) {return ::strstr(__s1, __s2);} +inline _LIBCPP_INLINE_VISIBILITY char* strchr(char* __s, int __c) {return ::strchr(__s, __c);} +inline _LIBCPP_INLINE_VISIBILITY char* strpbrk(char* __s1, const char* __s2) {return ::strpbrk(__s1, __s2);} +inline _LIBCPP_INLINE_VISIBILITY char* strrchr(char* __s, int __c) {return ::strrchr(__s, __c);} +inline _LIBCPP_INLINE_VISIBILITY void* memchr(void* __s, int __c, size_t __n) {return ::memchr(__s, __c, __n);} +inline _LIBCPP_INLINE_VISIBILITY char* strstr(char* __s1, const char* __s2) {return ::strstr(__s1, __s2);} #endif -#ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS -using ::strtok; +} #endif -using ::memset; -using ::strerror; -using ::strlen; -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP_CSTRING +#endif // _LIBCPP_STRING_H Index: include/wchar.h =================================================================== --- include/wchar.h +++ include/wchar.h @@ -1,5 +1,5 @@ // -*- C++ -*- -//===--------------------------- cwchar -----------------------------------===// +//===--------------------------- wchar.h ----------------------------------===// // // The LLVM Compiler Infrastructure // @@ -8,11 +8,14 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_CWCHAR -#define _LIBCPP_CWCHAR +#if defined(__need_wint_t) || defined(__need_mbstate_t) +#include_next +#elif !defined(_LIBCPP_WCHAR_H) +#define _LIBCPP_WCHAR_H + /* - cwchar synopsis + wchar.h synopsis Macros: @@ -21,9 +24,6 @@ WCHAR_MIN WEOF -namespace std -{ - Types: mbstate_t @@ -99,127 +99,33 @@ size_t wcsrtombs(char* restrict dst, const wchar_t** restrict src, size_t len, mbstate_t* restrict ps); -} // std - */ #include <__config> -#include -#include -#if defined(_LIBCPP_MSVCRT) || defined(__MINGW32__) -#include // pull in *swprintf defines -#endif // _LIBCPP_MSVCRT +#ifdef __cplusplus +#define __CORRECT_ISO_CPP_WCHAR_H_PROTO +#endif + +#include_next + #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif -_LIBCPP_BEGIN_NAMESPACE_STD - -using ::mbstate_t; -using ::size_t; -using ::tm; -using ::wint_t; -using ::FILE; -using ::fwprintf; -using ::fwscanf; -using ::swprintf; -using ::vfwprintf; -using ::vswprintf; -#ifndef _LIBCPP_MSVCRT -using ::swscanf; -using ::vfwscanf; -using ::vswscanf; -#endif // _LIBCPP_MSVCRT -using ::fgetwc; -using ::fgetws; -using ::fputwc; -using ::fputws; -using ::fwide; -using ::getwc; -using ::putwc; -using ::ungetwc; -using ::wcstod; -#ifndef _LIBCPP_MSVCRT -using ::wcstof; -using ::wcstold; -#endif // _LIBCPP_MSVCRT -using ::wcstol; -#ifndef _LIBCPP_HAS_NO_LONG_LONG -using ::wcstoll; -#endif // _LIBCPP_HAS_NO_LONG_LONG -using ::wcstoul; -#ifndef _LIBCPP_HAS_NO_LONG_LONG -using ::wcstoull; -#endif // _LIBCPP_HAS_NO_LONG_LONG -using ::wcscpy; -using ::wcsncpy; -using ::wcscat; -using ::wcsncat; -using ::wcscmp; -using ::wcscoll; -using ::wcsncmp; -using ::wcsxfrm; - +// Let know if we have const-correct overloads for wcschr and friends. #if defined(_WCHAR_H_CPLUSPLUS_98_CONFORMANCE_) - -using ::wcschr; -using ::wcspbrk; -using ::wcsrchr; -using ::wcsstr; -using ::wmemchr; - -#else - -inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcschr(const wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);} -inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcschr( wchar_t* __s, wchar_t __c) {return ::wcschr(__s, __c);} - -inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcspbrk(const wchar_t* __s1, const wchar_t* __s2) {return ::wcspbrk(__s1, __s2);} -inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcspbrk( wchar_t* __s1, const wchar_t* __s2) {return ::wcspbrk(__s1, __s2);} - -inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsrchr(const wchar_t* __s, wchar_t __c) {return ::wcsrchr(__s, __c);} -inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcsrchr( wchar_t* __s, wchar_t __c) {return ::wcsrchr(__s, __c);} - -inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wcsstr(const wchar_t* __s1, const wchar_t* __s2) {return ::wcsstr(__s1, __s2);} -inline _LIBCPP_INLINE_VISIBILITY wchar_t* wcsstr( wchar_t* __s1, const wchar_t* __s2) {return ::wcsstr(__s1, __s2);} - -inline _LIBCPP_INLINE_VISIBILITY const wchar_t* wmemchr(const wchar_t* __s, wchar_t __c, size_t __n) {return ::wmemchr(__s, __c, __n);} -inline _LIBCPP_INLINE_VISIBILITY wchar_t* wmemchr( wchar_t* __s, wchar_t __c, size_t __n) {return ::wmemchr(__s, __c, __n);} - +# define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1 +#elif defined(__GLIBC_PREREQ) +# if __GLIBC_PREREQ(2, 10) +# define _LIBCPP_WCHAR_H_HAS_CONST_OVERLOADS 1 +# endif #endif -using ::wcscspn; -using ::wcslen; -using ::wcsspn; -using ::wcstok; -using ::wmemcmp; -using ::wmemcpy; -using ::wmemmove; -using ::wmemset; -using ::wcsftime; -using ::btowc; -using ::wctob; -using ::mbsinit; -using ::mbrlen; -using ::mbrtowc; -using ::wcrtomb; -using ::mbsrtowcs; -using ::wcsrtombs; +#if defined(__cplusplus) && (defined(_LIBCPP_MSVCRT) || defined(__MINGW32__)) +extern "C++" { +#include // pull in *swprintf defines +} // extern "C++" +#endif // __cplusplus && _LIBCPP_MSVCRT -#ifndef _LIBCPP_HAS_NO_STDIN -using ::getwchar; -#ifndef _LIBCPP_MSVCRT -using ::vwscanf; -#endif // _LIBCPP_MSVCRT -using ::wscanf; -#endif - -#ifndef _LIBCPP_HAS_NO_STDOUT -using ::putwchar; -using ::vwprintf; -using ::wprintf; -#endif - -_LIBCPP_END_NAMESPACE_STD - -#endif // _LIBCPP_CWCHAR +#endif // _LIBCPP_WCHAR_H Index: include/wctype.h =================================================================== --- include/wctype.h +++ include/wctype.h @@ -1,5 +1,5 @@ // -*- C++ -*- -//===--------------------------- cwctype ----------------------------------===// +//===--------------------------- wctype.h ---------------------------------===// // // The LLVM Compiler Infrastructure // @@ -8,19 +8,16 @@ // //===----------------------------------------------------------------------===// -#ifndef _LIBCPP_CWCTYPE -#define _LIBCPP_CWCTYPE +#ifndef _LIBCPP_WCTYPE_H +#define _LIBCPP_WCTYPE_H /* - cwctype synopsis + wctype.h synopsis Macros: WEOF -namespace std -{ - Types: wint_t @@ -46,168 +43,36 @@ wint_t towctrans(wint_t wc, wctrans_t desc); wctrans_t wctrans(const char* property); -} // std - */ #include <__config> -#include -#include +#include_next #if !defined(_LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER) #pragma GCC system_header #endif -_LIBCPP_BEGIN_NAMESPACE_STD +#ifdef __cplusplus -using ::wint_t; -using ::wctrans_t; -using ::wctype_t; - -#ifdef iswalnum -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswalnum(wint_t __wc) {return iswalnum(__wc);} #undef iswalnum -inline _LIBCPP_INLINE_VISIBILITY int iswalnum(wint_t __wc) {return __libcpp_iswalnum(__wc);} -#else // iswalnum -using ::iswalnum; -#endif - -#ifdef iswalpha -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswalpha(wint_t __wc) {return iswalpha(__wc);} #undef iswalpha -inline _LIBCPP_INLINE_VISIBILITY int iswalpha(wint_t __wc) {return __libcpp_iswalpha(__wc);} -#else // iswalpha -using ::iswalpha; -#endif - -#ifdef iswblank -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswblank(wint_t __wc) {return iswblank(__wc);} #undef iswblank -inline _LIBCPP_INLINE_VISIBILITY int iswblank(wint_t __wc) {return __libcpp_iswblank(__wc);} -#else // iswblank -using ::iswblank; -#endif - -#ifdef iswcntrl -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswcntrl(wint_t __wc) {return iswcntrl(__wc);} #undef iswcntrl -inline _LIBCPP_INLINE_VISIBILITY int iswcntrl(wint_t __wc) {return __libcpp_iswcntrl(__wc);} -#else // iswcntrl -using ::iswcntrl; -#endif - -#ifdef iswdigit -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswdigit(wint_t __wc) {return iswdigit(__wc);} #undef iswdigit -inline _LIBCPP_INLINE_VISIBILITY int iswdigit(wint_t __wc) {return __libcpp_iswdigit(__wc);} -#else // iswdigit -using ::iswdigit; -#endif - -#ifdef iswgraph -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswgraph(wint_t __wc) {return iswgraph(__wc);} #undef iswgraph -inline _LIBCPP_INLINE_VISIBILITY int iswgraph(wint_t __wc) {return __libcpp_iswgraph(__wc);} -#else // iswgraph -using ::iswgraph; -#endif - -#ifdef iswlower -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswlower(wint_t __wc) {return iswlower(__wc);} #undef iswlower -inline _LIBCPP_INLINE_VISIBILITY int iswlower(wint_t __wc) {return __libcpp_iswlower(__wc);} -#else // iswlower -using ::iswlower; -#endif - -#ifdef iswprint -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswprint(wint_t __wc) {return iswprint(__wc);} #undef iswprint -inline _LIBCPP_INLINE_VISIBILITY int iswprint(wint_t __wc) {return __libcpp_iswprint(__wc);} -#else // iswprint -using ::iswprint; -#endif - -#ifdef iswpunct -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswpunct(wint_t __wc) {return iswpunct(__wc);} #undef iswpunct -inline _LIBCPP_INLINE_VISIBILITY int iswpunct(wint_t __wc) {return __libcpp_iswpunct(__wc);} -#else // iswpunct -using ::iswpunct; -#endif - -#ifdef iswspace -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswspace(wint_t __wc) {return iswspace(__wc);} #undef iswspace -inline _LIBCPP_INLINE_VISIBILITY int iswspace(wint_t __wc) {return __libcpp_iswspace(__wc);} -#else // iswspace -using ::iswspace; -#endif - -#ifdef iswupper -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswupper(wint_t __wc) {return iswupper(__wc);} #undef iswupper -inline _LIBCPP_INLINE_VISIBILITY int iswupper(wint_t __wc) {return __libcpp_iswupper(__wc);} -#else // iswupper -using ::iswupper; -#endif - -#ifdef iswxdigit -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswxdigit(wint_t __wc) {return iswxdigit(__wc);} #undef iswxdigit -inline _LIBCPP_INLINE_VISIBILITY int iswxdigit(wint_t __wc) {return __libcpp_iswxdigit(__wc);} -#else // iswxdigit -using ::iswxdigit; -#endif - -#ifdef iswctype -inline _LIBCPP_INLINE_VISIBILITY int __libcpp_iswctype(wint_t __w, wctype_t __d) {return iswctype(__w, __d);} #undef iswctype -inline _LIBCPP_INLINE_VISIBILITY int iswctype(wint_t __w, wctype_t __d) {return __libcpp_iswctype(__w, __d);} -#else // iswctype -using ::iswctype; -#endif - -#ifdef wctype -inline _LIBCPP_INLINE_VISIBILITY wctype_t __libcpp_wctype(const char* __p) {return wctype(__p);} #undef wctype -inline _LIBCPP_INLINE_VISIBILITY wctype_t wctype(const char* __p) {return __libcpp_wctype(__p);} -#else // wctype -using ::wctype; -#endif - -#ifdef towlower -inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towlower(wint_t __wc) {return towlower(__wc);} #undef towlower -inline _LIBCPP_INLINE_VISIBILITY wint_t towlower(wint_t __wc) {return __libcpp_towlower(__wc);} -#else // towlower -using ::towlower; -#endif - -#ifdef towupper -inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towupper(wint_t __wc) {return towupper(__wc);} #undef towupper -inline _LIBCPP_INLINE_VISIBILITY wint_t towupper(wint_t __wc) {return __libcpp_towupper(__wc);} -#else // towupper -using ::towupper; -#endif - -#ifdef towctrans -inline _LIBCPP_INLINE_VISIBILITY wint_t __libcpp_towctrans(wint_t __wc, wctype_t __d) {return towctrans(__wc, __d);} #undef towctrans -inline _LIBCPP_INLINE_VISIBILITY wint_t towctrans(wint_t __wc, wctype_t __d) {return __libcpp_towctrans(__wc, __d);} -#else // towctrans -using ::towctrans; -#endif - -#ifdef wctrans -inline _LIBCPP_INLINE_VISIBILITY wctrans_t __libcpp_wctrans(const char* __p) {return wctrans(__p);} #undef wctrans -inline _LIBCPP_INLINE_VISIBILITY wctrans_t wctrans(const char* __p) {return __libcpp_wctrans(__p);} -#else // wctrans -using ::wctrans; -#endif -_LIBCPP_END_NAMESPACE_STD +#endif // __cplusplus -#endif // _LIBCPP_CWCTYPE +#endif // _LIBCPP_WCTYPE_H Index: lib/buildit =================================================================== --- lib/buildit +++ lib/buildit @@ -123,7 +123,7 @@ SOEXT=so LDSHARED_FLAGS="-o libc++.so.1.0 \ -shared -nodefaultlibs -Wl,-soname,libc++.so.1 \ - -lpthread -lrt -lc -lstdc++" + -lpthread -lrt -lc -lc++abi" ;; esac @@ -144,9 +144,10 @@ done ;; esac -$CC *.o $RC_CFLAGS $LDSHARED_FLAGS $EXTRA_FLAGS +$CC *.o ~/libcxxabi/lib/*.o $RC_CFLAGS $LDSHARED_FLAGS $EXTRA_FLAGS #libtool -static -o libc++.a *.o +#ar rusc libc++.a *.o # Create the link for the final library name, so that we can use this directory # as a link target for the tests. @@ -173,7 +174,7 @@ ;; esac -if [ -z "$RC_XBS" ] -then - rm *.o -fi +#if [ -z "$RC_XBS" ] +#then +# rm *.o +#fi Index: test/std/depr/depr.c.headers/inttypes_h.pass.cpp =================================================================== --- test/std/depr/depr.c.headers/inttypes_h.pass.cpp +++ test/std/depr/depr.c.headers/inttypes_h.pass.cpp @@ -12,6 +12,250 @@ #include #include +#ifndef INT8_MIN +#error INT8_MIN not defined +#endif + +#ifndef INT16_MIN +#error INT16_MIN not defined +#endif + +#ifndef INT32_MIN +#error INT32_MIN not defined +#endif + +#ifndef INT64_MIN +#error INT64_MIN not defined +#endif + +#ifndef INT8_MAX +#error INT8_MAX not defined +#endif + +#ifndef INT16_MAX +#error INT16_MAX not defined +#endif + +#ifndef INT32_MAX +#error INT32_MAX not defined +#endif + +#ifndef INT64_MAX +#error INT64_MAX not defined +#endif + +#ifndef UINT8_MAX +#error UINT8_MAX not defined +#endif + +#ifndef UINT16_MAX +#error UINT16_MAX not defined +#endif + +#ifndef UINT32_MAX +#error UINT32_MAX not defined +#endif + +#ifndef UINT64_MAX +#error UINT64_MAX not defined +#endif + +#ifndef INT_LEAST8_MIN +#error INT_LEAST8_MIN not defined +#endif + +#ifndef INT_LEAST16_MIN +#error INT_LEAST16_MIN not defined +#endif + +#ifndef INT_LEAST32_MIN +#error INT_LEAST32_MIN not defined +#endif + +#ifndef INT_LEAST64_MIN +#error INT_LEAST64_MIN not defined +#endif + +#ifndef INT_LEAST8_MAX +#error INT_LEAST8_MAX not defined +#endif + +#ifndef INT_LEAST16_MAX +#error INT_LEAST16_MAX not defined +#endif + +#ifndef INT_LEAST32_MAX +#error INT_LEAST32_MAX not defined +#endif + +#ifndef INT_LEAST64_MAX +#error INT_LEAST64_MAX not defined +#endif + +#ifndef UINT_LEAST8_MAX +#error UINT_LEAST8_MAX not defined +#endif + +#ifndef UINT_LEAST16_MAX +#error UINT_LEAST16_MAX not defined +#endif + +#ifndef UINT_LEAST32_MAX +#error UINT_LEAST32_MAX not defined +#endif + +#ifndef UINT_LEAST64_MAX +#error UINT_LEAST64_MAX not defined +#endif + +#ifndef INT_FAST8_MIN +#error INT_FAST8_MIN not defined +#endif + +#ifndef INT_FAST16_MIN +#error INT_FAST16_MIN not defined +#endif + +#ifndef INT_FAST32_MIN +#error INT_FAST32_MIN not defined +#endif + +#ifndef INT_FAST64_MIN +#error INT_FAST64_MIN not defined +#endif + +#ifndef INT_FAST8_MAX +#error INT_FAST8_MAX not defined +#endif + +#ifndef INT_FAST16_MAX +#error INT_FAST16_MAX not defined +#endif + +#ifndef INT_FAST32_MAX +#error INT_FAST32_MAX not defined +#endif + +#ifndef INT_FAST64_MAX +#error INT_FAST64_MAX not defined +#endif + +#ifndef UINT_FAST8_MAX +#error UINT_FAST8_MAX not defined +#endif + +#ifndef UINT_FAST16_MAX +#error UINT_FAST16_MAX not defined +#endif + +#ifndef UINT_FAST32_MAX +#error UINT_FAST32_MAX not defined +#endif + +#ifndef UINT_FAST64_MAX +#error UINT_FAST64_MAX not defined +#endif + +#ifndef INTPTR_MIN +#error INTPTR_MIN not defined +#endif + +#ifndef INTPTR_MAX +#error INTPTR_MAX not defined +#endif + +#ifndef UINTPTR_MAX +#error UINTPTR_MAX not defined +#endif + +#ifndef INTMAX_MIN +#error INTMAX_MIN not defined +#endif + +#ifndef INTMAX_MAX +#error INTMAX_MAX not defined +#endif + +#ifndef UINTMAX_MAX +#error UINTMAX_MAX not defined +#endif + +#ifndef PTRDIFF_MIN +#error PTRDIFF_MIN not defined +#endif + +#ifndef PTRDIFF_MAX +#error PTRDIFF_MAX not defined +#endif + +#ifndef SIG_ATOMIC_MIN +#error SIG_ATOMIC_MIN not defined +#endif + +#ifndef SIG_ATOMIC_MAX +#error SIG_ATOMIC_MAX not defined +#endif + +#ifndef SIZE_MAX +#error SIZE_MAX not defined +#endif + +#ifndef WCHAR_MIN +#error WCHAR_MIN not defined +#endif + +#ifndef WCHAR_MAX +#error WCHAR_MAX not defined +#endif + +#ifndef WINT_MIN +#error WINT_MIN not defined +#endif + +#ifndef WINT_MAX +#error WINT_MAX not defined +#endif + +#ifndef INT8_C +#error INT8_C not defined +#endif + +#ifndef INT16_C +#error INT16_C not defined +#endif + +#ifndef INT32_C +#error INT32_C not defined +#endif + +#ifndef INT64_C +#error INT64_C not defined +#endif + +#ifndef UINT8_C +#error UINT8_C not defined +#endif + +#ifndef UINT16_C +#error UINT16_C not defined +#endif + +#ifndef UINT32_C +#error UINT32_C not defined +#endif + +#ifndef UINT64_C +#error UINT64_C not defined +#endif + +#ifndef INTMAX_C +#error INTMAX_C not defined +#endif + +#ifndef UINTMAX_C +#error UINTMAX_C not defined +#endif + #ifndef PRId8 #error PRId8 not defined #endif @@ -631,9 +875,50 @@ int main() { { - imaxdiv_t i1 = {0}; - ((void)i1); + int8_t i1 = 0; + int16_t i2 = 0; + int32_t i3 = 0; + int64_t i4 = 0; } + { + uint8_t i1 = 0; + uint16_t i2 = 0; + uint32_t i3 = 0; + uint64_t i4 = 0; + } + { + int_least8_t i1 = 0; + int_least16_t i2 = 0; + int_least32_t i3 = 0; + int_least64_t i4 = 0; + } + { + uint_least8_t i1 = 0; + uint_least16_t i2 = 0; + uint_least32_t i3 = 0; + uint_least64_t i4 = 0; + } + { + int_fast8_t i1 = 0; + int_fast16_t i2 = 0; + int_fast32_t i3 = 0; + int_fast64_t i4 = 0; + } + { + uint_fast8_t i1 = 0; + uint_fast16_t i2 = 0; + uint_fast32_t i3 = 0; + uint_fast64_t i4 = 0; + } + { + intptr_t i1 = 0; + uintptr_t i2 = 0; + intmax_t i3 = 0; + uintmax_t i4 = 0; + } + { + imaxdiv_t i1 = {0}; + } intmax_t i = 0; static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); Index: test/std/depr/depr.c.headers/math_h.pass.cpp =================================================================== --- test/std/depr/depr.c.headers/math_h.pass.cpp +++ test/std/depr/depr.c.headers/math_h.pass.cpp @@ -9,7 +9,8 @@ // -// XFAIL: linux +// NOTE: isinf and isnan are tested separately because they are expected to fail +// on linux. We don't want their expected failure to hide other failures in this file. #include #include @@ -17,91 +18,311 @@ #include "hexfloat.h" +// convertible to int/float/double/etc +template +struct Value { + operator T () { return T(N); } +}; + +// See PR21083 +// Ambiguous is a user-defined type that defines its own overloads of cmath +// functions. When the std overloads are candidates too (by using or adl), +// they should not interfere. +struct Ambiguous : std::true_type { // ADL + operator float () { return 0.f; } + operator double () { return 0.; } +}; +Ambiguous abs(Ambiguous){ return Ambiguous(); } +Ambiguous acos(Ambiguous){ return Ambiguous(); } +Ambiguous asin(Ambiguous){ return Ambiguous(); } +Ambiguous atan(Ambiguous){ return Ambiguous(); } +Ambiguous atan2(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous ceil(Ambiguous){ return Ambiguous(); } +Ambiguous cos(Ambiguous){ return Ambiguous(); } +Ambiguous cosh(Ambiguous){ return Ambiguous(); } +Ambiguous exp(Ambiguous){ return Ambiguous(); } +Ambiguous fabs(Ambiguous){ return Ambiguous(); } +Ambiguous floor(Ambiguous){ return Ambiguous(); } +Ambiguous fmod(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous frexp(Ambiguous, int*){ return Ambiguous(); } +Ambiguous ldexp(Ambiguous, int){ return Ambiguous(); } +Ambiguous log(Ambiguous){ return Ambiguous(); } +Ambiguous log10(Ambiguous){ return Ambiguous(); } +Ambiguous modf(Ambiguous, Ambiguous*){ return Ambiguous(); } +Ambiguous pow(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous sin(Ambiguous){ return Ambiguous(); } +Ambiguous sinh(Ambiguous){ return Ambiguous(); } +Ambiguous sqrt(Ambiguous){ return Ambiguous(); } +Ambiguous tan(Ambiguous){ return Ambiguous(); } +Ambiguous tanh(Ambiguous){ return Ambiguous(); } +Ambiguous signbit(Ambiguous){ return Ambiguous(); } +Ambiguous fpclassify(Ambiguous){ return Ambiguous(); } +Ambiguous isfinite(Ambiguous){ return Ambiguous(); } +Ambiguous isnormal(Ambiguous){ return Ambiguous(); } +Ambiguous isgreater(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous isgreaterequal(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous isless(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous islessequal(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous islessgreater(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous isunordered(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous acosh(Ambiguous){ return Ambiguous(); } +Ambiguous asinh(Ambiguous){ return Ambiguous(); } +Ambiguous atanh(Ambiguous){ return Ambiguous(); } +Ambiguous cbrt(Ambiguous){ return Ambiguous(); } +Ambiguous copysign(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous erf(Ambiguous){ return Ambiguous(); } +Ambiguous erfc(Ambiguous){ return Ambiguous(); } +Ambiguous exp2(Ambiguous){ return Ambiguous(); } +Ambiguous expm1(Ambiguous){ return Ambiguous(); } +Ambiguous fdim(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous fma(Ambiguous, Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous fmax(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous fmin(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous hypot(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous ilogb(Ambiguous){ return Ambiguous(); } +Ambiguous lgamma(Ambiguous){ return Ambiguous(); } +Ambiguous llrint(Ambiguous){ return Ambiguous(); } +Ambiguous llround(Ambiguous){ return Ambiguous(); } +Ambiguous log1p(Ambiguous){ return Ambiguous(); } +Ambiguous log2(Ambiguous){ return Ambiguous(); } +Ambiguous logb(Ambiguous){ return Ambiguous(); } +Ambiguous lrint(Ambiguous){ return Ambiguous(); } +Ambiguous lround(Ambiguous){ return Ambiguous(); } +Ambiguous nearbyint(Ambiguous){ return Ambiguous(); } +Ambiguous nextafter(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous nexttoward(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous remainder(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous remquo(Ambiguous, Ambiguous, int*){ return Ambiguous(); } +Ambiguous rint(Ambiguous){ return Ambiguous(); } +Ambiguous round(Ambiguous){ return Ambiguous(); } +Ambiguous scalbln(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous scalbn(Ambiguous, Ambiguous){ return Ambiguous(); } +Ambiguous tgamma(Ambiguous){ return Ambiguous(); } +Ambiguous trunc(Ambiguous){ return Ambiguous(); } + +void test_abs() +{ + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + assert(abs(-1.) == 1); +} + void test_acos() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(acos(1) == 0); } void test_asin() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(asin(0) == 0); } void test_atan() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(atan(0) == 0); } void test_atan2() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(atan2(0,1) == 0); } void test_ceil() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(ceil(0) == 0); } void test_cos() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(cos(0) == 1); } void test_cosh() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(cosh(0) == 1); } void test_exp() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(exp(0) == 1); } void test_fabs() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - assert(fabs(-1.f) == 1); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + assert(fabs(-1) == 1); } void test_floor() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(floor(1) == 1); } void test_fmod() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(fmod(1.5,1) == .5); } @@ -108,9 +329,20 @@ void test_frexp() { int ip; + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(frexp(0, &ip) == 0); } @@ -117,33 +349,69 @@ void test_ldexp() { int ip = 1; + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(ldexp(1, ip) == 2); } void test_log() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(log(1) == 0); } void test_log10() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(log10(1) == 0); } void test_modf() { + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); double i; assert(modf(1., &i) == 0); } @@ -150,365 +418,768 @@ void test_pow() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); +// static_assert((std::is_same(), (int)0)), double>::value), ""); +// static_assert((std::is_same(), (float)0)), long double>::value), ""); +// static_assert((std::is_same())), float>::value), ""); + static_assert((std::is_same::value), ""); assert(pow(1,1) == 1); +// assert(pow(Value(), Value()) == 1); +// assert(pow(1.0f, Value()) == 1); +// assert(pow(1.0, Value()) == 1); +// assert(pow(Value(), 1LL) == 1); } void test_sin() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(sin(0) == 0); } void test_sinh() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(sinh(0) == 0); } void test_sqrt() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(sqrt(4) == 2); } void test_tan() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(tan(0) == 0); } void test_tanh() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(tanh(0) == 0); } void test_signbit() { +#ifdef signbit +#error signbit defined +#endif static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(signbit(-1.0) == true); } void test_fpclassify() { +#ifdef fpclassify +#error fpclassify defined +#endif static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(fpclassify(-1.0) == FP_NORMAL); } void test_isfinite() { +#ifdef isfinite +#error isfinite defined +#endif static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(isfinite(-1.0) == true); } -void test_isinf() -{ - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - assert(isinf(-1.0) == false); -} - -void test_isnan() -{ - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - assert(isnan(-1.0) == false); -} - void test_isnormal() { +#ifdef isnormal +#error isnormal defined +#endif static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(isnormal(-1.0) == true); } void test_isgreater() { +#ifdef isgreater +#error isgreater defined +#endif static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(isgreater(-1.0, 0.F) == false); } void test_isgreaterequal() { +#ifdef isgreaterequal +#error isgreaterequal defined +#endif static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(isgreaterequal(-1.0, 0.F) == false); } void test_isless() { +#ifdef isless +#error isless defined +#endif static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(isless(-1.0, 0.F) == true); } void test_islessequal() { +#ifdef islessequal +#error islessequal defined +#endif static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(islessequal(-1.0, 0.F) == true); } void test_islessgreater() { +#ifdef islessgreater +#error islessgreater defined +#endif static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(islessgreater(-1.0, 0.F) == true); } void test_isunordered() { +#ifdef isunordered +#error isunordered defined +#endif static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(isunordered(-1.0, 0.F) == false); } void test_acosh() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(acosh(1) == 0); } void test_asinh() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(asinh(0) == 0); } void test_atanh() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(atanh(0) == 0); } void test_cbrt() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(cbrt(1) == 1); } void test_copysign() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(copysign(1,1) == 1); } void test_erf() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(erf(0) == 0); } void test_erfc() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(erfc(0) == 1); } void test_exp2() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(exp2(1) == 2); } void test_expm1() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(expm1(0) == 0); } void test_fdim() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(fdim(1,0) == 1); } void test_fma() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(fma(1,1,1) == 2); } void test_fmax() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(fmax(1,0) == 1); } void test_fmin() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(fmin(1,0) == 0); } void test_hypot() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(hypot(3,4) == 5); } void test_ilogb() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(ilogb(1) == 0); } void test_lgamma() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(lgamma(1) == 0); } void test_llrint() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(llrint(1) == 1LL); } void test_llround() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(llround(1) == 1LL); } void test_log1p() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(log1p(0) == 0); } void test_log2() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(log2(1) == 0); } void test_logb() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(logb(1) == 0); } void test_lrint() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(lrint(1) == 1L); } void test_lround() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(lround(1) == 1L); } @@ -521,34 +1192,85 @@ void test_nearbyint() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(nearbyint(1) == 1); } void test_nextafter() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(nextafter(0,1) == hexfloat(0x1, 0, -1074)); } void test_nexttoward() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(nexttoward(0, 1) == hexfloat(0x1, 0, -1074)); } void test_remainder() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(remainder(0.5,1) == 0.5); } @@ -555,62 +1277,144 @@ void test_remquo() { int ip; + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(remquo(0.5,1, &ip) == 0.5); } void test_rint() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(rint(1) == 1); } void test_round() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(round(1) == 1); } void test_scalbln() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(scalbln(1, 1) == 2); } void test_scalbn() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(scalbn(1, 1) == 2); } void test_tgamma() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(tgamma(1) == 1); } void test_trunc() { + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); assert(trunc(1) == 1); } int main() { + test_abs(); test_acos(); test_asin(); test_atan(); @@ -636,8 +1440,6 @@ test_signbit(); test_fpclassify(); test_isfinite(); - test_isinf(); - test_isnan(); test_isnormal(); test_isgreater(); test_isgreaterequal(); Index: test/std/depr/depr.c.headers/math_h_isinf.pass.cpp =================================================================== --- test/std/depr/depr.c.headers/math_h_isinf.pass.cpp +++ test/std/depr/depr.c.headers/math_h_isinf.pass.cpp @@ -0,0 +1,30 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// isinf + +// XFAIL: linux + +#include +#include +#include + +int main() +{ +#ifdef isinf +#error isinf defined +#endif + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + assert(isinf(-1.0) == false); +} Index: test/std/depr/depr.c.headers/math_h_isnan.pass.cpp =================================================================== --- test/std/depr/depr.c.headers/math_h_isnan.pass.cpp +++ test/std/depr/depr.c.headers/math_h_isnan.pass.cpp @@ -0,0 +1,30 @@ +//===----------------------------------------------------------------------===// +// +// The LLVM Compiler Infrastructure +// +// This file is dual licensed under the MIT and the University of Illinois Open +// Source Licenses. See LICENSE.TXT for details. +// +//===----------------------------------------------------------------------===// + +// + +// isnan + +// XFAIL: linux + +#include +#include +#include + +int main() +{ +#ifdef isnan +#error isnan defined +#endif + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + assert(isnan(-1.0) == false); +} Index: test/std/depr/depr.c.headers/setjmp_h.pass.cpp =================================================================== --- test/std/depr/depr.c.headers/setjmp_h.pass.cpp +++ test/std/depr/depr.c.headers/setjmp_h.pass.cpp @@ -12,6 +12,10 @@ #include #include +#ifndef setjmp +#error setjmp not defined +#endif + int main() { jmp_buf jb; Index: test/std/depr/depr.c.headers/stddef_h.pass.cpp =================================================================== --- test/std/depr/depr.c.headers/stddef_h.pass.cpp +++ test/std/depr/depr.c.headers/stddef_h.pass.cpp @@ -10,6 +10,7 @@ // #include +#include #include #ifndef NULL @@ -22,6 +23,9 @@ int main() { + void *p = NULL; + assert(!p); + static_assert(sizeof(size_t) == sizeof(void*), "sizeof(size_t) == sizeof(void*)"); static_assert(std::is_unsigned::value, @@ -34,4 +38,22 @@ "std::is_signed::value"); static_assert(std::is_integral::value, "std::is_integral::value"); + static_assert(std::is_same::value, + "decltype(nullptr) == nullptr_t"); + static_assert(sizeof(nullptr_t) == sizeof(void*), + "sizeof(nullptr_t) == sizeof(void*)"); + static_assert(std::is_pod::value, + "std::is_pod::value"); + static_assert((std::alignment_of::value >= + std::alignment_of::value), + "std::alignment_of::value >= " + "std::alignment_of::value"); + static_assert(std::alignment_of::value >= + std::alignment_of::value, + "std::alignment_of::value >= " + "std::alignment_of::value"); + static_assert(std::alignment_of::value >= + std::alignment_of::value, + "std::alignment_of::value >= " + "std::alignment_of::value"); } Index: test/std/depr/depr.c.headers/stdio_h.pass.cpp =================================================================== --- test/std/depr/depr.c.headers/stdio_h.pass.cpp +++ test/std/depr/depr.c.headers/stdio_h.pass.cpp @@ -13,6 +13,26 @@ #include #include "test_macros.h" +#ifdef getc +#error getc is defined +#endif + +#ifdef putc +#error putc is defined +#endif + +#ifdef clearerr +#error clearerr is defined +#endif + +#ifdef feof +#error feof is defined +#endif + +#ifdef ferror +#error ferror is defined +#endif + #ifndef BUFSIZ #error BUFSIZ not defined #endif Index: test/std/depr/depr.c.headers/stdlib_h.pass.cpp =================================================================== --- test/std/depr/depr.c.headers/stdlib_h.pass.cpp +++ test/std/depr/depr.c.headers/stdlib_h.pass.cpp @@ -12,6 +12,30 @@ #include #include +#ifdef abs +#error abs is defined +#endif + +#ifdef labs +#error labs is defined +#endif + +#ifdef llabs +#error llabs is defined +#endif + +#ifdef div +#error div is defined +#endif + +#ifdef ldiv +#error ldiv is defined +#endif + +#ifdef lldiv +#error lldiv is defined +#endif + #ifndef EXIT_FAILURE #error EXIT_FAILURE not defined #endif Index: test/std/depr/depr.c.headers/wchar_h.pass.cpp =================================================================== --- test/std/depr/depr.c.headers/wchar_h.pass.cpp +++ test/std/depr/depr.c.headers/wchar_h.pass.cpp @@ -28,10 +28,6 @@ #error WEOF not defined #endif -#if defined(__clang__) -#pragma clang diagnostic ignored "-Wmissing-braces" -#endif - int main() { mbstate_t mb = {0}; @@ -54,10 +50,6 @@ static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); @@ -64,9 +56,7 @@ static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); - static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); @@ -83,14 +73,19 @@ static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); @@ -105,4 +100,16 @@ static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); + +#ifndef _LIBCPP_HAS_NO_STDIN + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); +#endif + +#ifndef _LIBCPP_HAS_NO_STDOUT + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); + static_assert((std::is_same::value), ""); +#endif } Index: test/std/strings/c.strings/cctype.pass.cpp =================================================================== --- test/std/strings/c.strings/cctype.pass.cpp +++ test/std/strings/c.strings/cctype.pass.cpp @@ -86,18 +86,18 @@ static_assert((std::is_same::value), ""); static_assert((std::is_same::value), ""); - assert(isalnum('a')); - assert(isalpha('a')); - assert(isblank(' ')); - assert(!iscntrl(' ')); - assert(!isdigit('a')); - assert(isgraph('a')); - assert(islower('a')); - assert(isprint('a')); - assert(!ispunct('a')); - assert(!isspace('a')); - assert(!isupper('a')); - assert(isxdigit('a')); - assert(tolower('A') == 'a'); - assert(toupper('a') == 'A'); + assert(std::isalnum('a')); + assert(std::isalpha('a')); + assert(std::isblank(' ')); + assert(!std::iscntrl(' ')); + assert(!std::isdigit('a')); + assert(std::isgraph('a')); + assert(std::islower('a')); + assert(std::isprint('a')); + assert(!std::ispunct('a')); + assert(!std::isspace('a')); + assert(!std::isupper('a')); + assert(std::isxdigit('a')); + assert(std::tolower('A') == 'a'); + assert(std::toupper('a') == 'A'); }