summaryrefslogtreecommitdiffstats
path: root/contrib/libc++
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2012-11-26 21:32:31 +0000
committerdim <dim@FreeBSD.org>2012-11-26 21:32:31 +0000
commitefc7663168c5fecceee060aa8248085b4b424c6e (patch)
tree791e1d661dc6735c2cb45184c6760859b8116384 /contrib/libc++
parenta094deb5eec583e8af69dd76ce2d7cdc77e2274d (diff)
downloadFreeBSD-src-efc7663168c5fecceee060aa8248085b4b424c6e.zip
FreeBSD-src-efc7663168c5fecceee060aa8248085b4b424c6e.tar.gz
Pull in r168610 from upstream libc++:
When using libc++ headers on FreeBSD, in combination with -std=c++98, -ansi or -std=c++03, the long long type is not supported. So in this case, several functions and types, like lldiv_t, strtoll(), are not declared. This should make it possible to use the libc++ headers in c++98 mode. Note: libc++ is originally designed as a c++0x or higher library, so you should still take care when using it with c++98 or c++03. Noted by: Yamaya Takashi <yamayan@kbh.biglobe.ne.jp> MFC after: 1 week
Diffstat (limited to 'contrib/libc++')
-rw-r--r--contrib/libc++/include/__config3
-rw-r--r--contrib/libc++/include/cstdlib16
-rw-r--r--contrib/libc++/include/cwchar4
3 files changed, 23 insertions, 0 deletions
diff --git a/contrib/libc++/include/__config b/contrib/libc++/include/__config
index 2bbe1d9..203be76 100644
--- a/contrib/libc++/include/__config
+++ b/contrib/libc++/include/__config
@@ -51,6 +51,9 @@
# define _LIBCPP_LITTLE_ENDIAN 0
# define _LIBCPP_BIG_ENDIAN 1
# endif // _BYTE_ORDER == _LITTLE_ENDIAN
+# ifndef __LONG_LONG_SUPPORTED
+# define _LIBCPP_HAS_NO_LONG_LONG
+# endif // __LONG_LONG_SUPPORTED
#endif // __FreeBSD__
#ifdef _WIN32
diff --git a/contrib/libc++/include/cstdlib b/contrib/libc++/include/cstdlib
index 7f6c6c8..95e3842 100644
--- a/contrib/libc++/include/cstdlib
+++ b/contrib/libc++/include/cstdlib
@@ -97,18 +97,26 @@ _LIBCPP_BEGIN_NAMESPACE_STD
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;
@@ -125,10 +133,14 @@ using ::bsearch;
using ::qsort;
using ::abs;
using ::labs;
+#ifndef _LIBCPP_HAS_NO_LONG_LONG
using ::llabs;
+#endif // _LIBCPP_HAS_NO_LONG_LONG
using ::div;
using ::ldiv;
+#ifndef _LIBCPP_HAS_NO_LONG_LONG
using ::lldiv;
+#endif // _LIBCPP_HAS_NO_LONG_LONG
using ::mblen;
using ::mbtowc;
using ::wctomb;
@@ -145,10 +157,14 @@ using ::aligned_alloc;
// MSVC already has the correct prototype in <stdlib.h.h> #ifdef __cplusplus
#if !defined(_MSC_VER) && !defined(__sun__)
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 // _MSC_VER
_LIBCPP_END_NAMESPACE_STD
diff --git a/contrib/libc++/include/cwchar b/contrib/libc++/include/cwchar
index 8e788fc..eed6de1 100644
--- a/contrib/libc++/include/cwchar
+++ b/contrib/libc++/include/cwchar
@@ -151,9 +151,13 @@ using ::wcstof;
using ::wcstold;
#endif // _MSC_VER
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;
OpenPOWER on IntegriCloud