[cfe-commits] [libcxx] r168610 - in /libcxx/trunk/include: __config cstdlib cwchar

Howard Hinnant hhinnant at apple.com
Mon Nov 26 13:18:17 PST 2012


Author: hhinnant
Date: Mon Nov 26 15:18:17 2012
New Revision: 168610

URL: http://llvm.org/viewvc/llvm-project?rev=168610&view=rev
Log:
Dimitry Andric:  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.

Modified:
    libcxx/trunk/include/__config
    libcxx/trunk/include/cstdlib
    libcxx/trunk/include/cwchar

Modified: libcxx/trunk/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/__config?rev=168610&r1=168609&r2=168610&view=diff
==============================================================================
--- libcxx/trunk/include/__config (original)
+++ libcxx/trunk/include/__config Mon Nov 26 15:18:17 2012
@@ -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

Modified: libcxx/trunk/include/cstdlib
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/cstdlib?rev=168610&r1=168609&r2=168610&view=diff
==============================================================================
--- libcxx/trunk/include/cstdlib (original)
+++ libcxx/trunk/include/cstdlib Mon Nov 26 15:18:17 2012
@@ -97,18 +97,26 @@
 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 ::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 @@
 // 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

Modified: libcxx/trunk/include/cwchar
URL: http://llvm.org/viewvc/llvm-project/libcxx/trunk/include/cwchar?rev=168610&r1=168609&r2=168610&view=diff
==============================================================================
--- libcxx/trunk/include/cwchar (original)
+++ libcxx/trunk/include/cwchar Mon Nov 26 15:18:17 2012
@@ -151,9 +151,13 @@
 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;





More information about the cfe-commits mailing list