[libcxx] r339992 - Merging r339816:

Hans Wennborg via cfe-commits cfe-commits at lists.llvm.org
Fri Aug 17 00:22:08 PDT 2018


Author: hans
Date: Fri Aug 17 00:22:08 2018
New Revision: 339992

URL: http://llvm.org/viewvc/llvm-project?rev=339992&view=rev
Log:
Merging r339816:
------------------------------------------------------------------------
r339816 | marshall | 2018-08-15 23:19:08 +0200 (Wed, 15 Aug 2018) | 1 line

Selectively import timespec_get into namespace std, since some C libraries don't have it. Reviewed as https://reviews.llvm.org/D50799
------------------------------------------------------------------------

Modified:
    libcxx/branches/release_70/   (props changed)
    libcxx/branches/release_70/include/__config
    libcxx/branches/release_70/include/cstdlib
    libcxx/branches/release_70/include/ctime
    libcxx/branches/release_70/test/std/language.support/support.runtime/ctime.pass.cpp
    libcxx/branches/release_70/test/std/utilities/time/date.time/ctime.pass.cpp
    libcxx/branches/release_70/test/support/test_macros.h

Propchange: libcxx/branches/release_70/
------------------------------------------------------------------------------
--- svn:mergeinfo (original)
+++ svn:mergeinfo Fri Aug 17 00:22:08 2018
@@ -1,2 +1,2 @@
 /libcxx/branches/apple:136569-137939
-/libcxx/trunk:339431,339675,339697,339702,339741-339743,339794,339804,339874
+/libcxx/trunk:339431,339675,339697,339702,339741-339743,339794,339804,339816,339874

Modified: libcxx/branches/release_70/include/__config
URL: http://llvm.org/viewvc/llvm-project/libcxx/branches/release_70/include/__config?rev=339992&r1=339991&r2=339992&view=diff
==============================================================================
--- libcxx/branches/release_70/include/__config (original)
+++ libcxx/branches/release_70/include/__config Fri Aug 17 00:22:08 2018
@@ -334,6 +334,7 @@
 #    define _LIBCPP_HAS_C11_FEATURES
 #  elif defined(__Fuchsia__)
 #    define _LIBCPP_HAS_QUICK_EXIT
+#    define _LIBCPP_HAS_TIMESPEC_GET
 #    define _LIBCPP_HAS_C11_FEATURES
 #  elif defined(__linux__)
 #    if !defined(_LIBCPP_HAS_MUSL_LIBC)
@@ -342,9 +343,11 @@
 #      endif
 #      if _LIBCPP_GLIBC_PREREQ(2, 17)
 #        define _LIBCPP_HAS_C11_FEATURES
+#        define _LIBCPP_HAS_TIMESPEC_GET
 #      endif
 #    else // defined(_LIBCPP_HAS_MUSL_LIBC)
 #      define _LIBCPP_HAS_QUICK_EXIT
+#      define _LIBCPP_HAS_TIMESPEC_GET
 #      define _LIBCPP_HAS_C11_FEATURES
 #    endif
 #  endif // __linux__

Modified: libcxx/branches/release_70/include/cstdlib
URL: http://llvm.org/viewvc/llvm-project/libcxx/branches/release_70/include/cstdlib?rev=339992&r1=339991&r2=339992&view=diff
==============================================================================
--- libcxx/branches/release_70/include/cstdlib (original)
+++ libcxx/branches/release_70/include/cstdlib Fri Aug 17 00:22:08 2018
@@ -151,11 +151,11 @@ using ::mbtowc;
 using ::wctomb;
 using ::mbstowcs;
 using ::wcstombs;
-#ifdef _LIBCPP_HAS_QUICK_EXIT
+#if !defined(_LIBCPP_CXX03_LANG) && defined(_LIBCPP_HAS_QUICK_EXIT)
 using ::at_quick_exit;
 using ::quick_exit;
 #endif
-#ifdef _LIBCPP_HAS_C11_FEATURES
+#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_C11_FEATURES)
 using ::aligned_alloc;
 #endif
 

Modified: libcxx/branches/release_70/include/ctime
URL: http://llvm.org/viewvc/llvm-project/libcxx/branches/release_70/include/ctime?rev=339992&r1=339991&r2=339992&view=diff
==============================================================================
--- libcxx/branches/release_70/include/ctime (original)
+++ libcxx/branches/release_70/include/ctime Fri Aug 17 00:22:08 2018
@@ -73,7 +73,7 @@ using ::gmtime;
 using ::localtime;
 #endif
 using ::strftime;
-#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_C11_FEATURES)
+#if _LIBCPP_STD_VER > 14 && defined(_LIBCPP_HAS_TIMESPEC_GET)
 using ::timespec_get;
 #endif
 

Modified: libcxx/branches/release_70/test/std/language.support/support.runtime/ctime.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/branches/release_70/test/std/language.support/support.runtime/ctime.pass.cpp?rev=339992&r1=339991&r2=339992&view=diff
==============================================================================
--- libcxx/branches/release_70/test/std/language.support/support.runtime/ctime.pass.cpp (original)
+++ libcxx/branches/release_70/test/std/language.support/support.runtime/ctime.pass.cpp Fri Aug 17 00:22:08 2018
@@ -45,7 +45,7 @@ int main()
     static_assert((std::is_same<decltype(std::difftime(t,t)), double>::value), "");
     static_assert((std::is_same<decltype(std::mktime(&tm)), std::time_t>::value), "");
     static_assert((std::is_same<decltype(std::time(&t)), std::time_t>::value), "");
-#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES)
+#if TEST_STD_VER > 14 && defined(TEST_HAS_TIMESPEC_GET)
     static_assert((std::is_same<decltype(std::timespec_get(nullptr, 0)), int>::value), "");
 #endif
 #ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS

Modified: libcxx/branches/release_70/test/std/utilities/time/date.time/ctime.pass.cpp
URL: http://llvm.org/viewvc/llvm-project/libcxx/branches/release_70/test/std/utilities/time/date.time/ctime.pass.cpp?rev=339992&r1=339991&r2=339992&view=diff
==============================================================================
--- libcxx/branches/release_70/test/std/utilities/time/date.time/ctime.pass.cpp (original)
+++ libcxx/branches/release_70/test/std/utilities/time/date.time/ctime.pass.cpp Fri Aug 17 00:22:08 2018
@@ -47,7 +47,7 @@ int main()
     static_assert((std::is_same<decltype(std::difftime(t,t)), double>::value), "");
     static_assert((std::is_same<decltype(std::mktime(&tm)), std::time_t>::value), "");
     static_assert((std::is_same<decltype(std::time(&t)), std::time_t>::value), "");
-#if TEST_STD_VER > 14 && defined(TEST_HAS_C11_FEATURES)
+#if TEST_STD_VER > 14 && defined(TEST_HAS_TIMESPEC_GET)
     static_assert((std::is_same<decltype(std::timespec_get(nullptr, 0)), int>::value), "");
 #endif
 #ifndef _LIBCPP_HAS_NO_THREAD_UNSAFE_C_FUNCTIONS

Modified: libcxx/branches/release_70/test/support/test_macros.h
URL: http://llvm.org/viewvc/llvm-project/libcxx/branches/release_70/test/support/test_macros.h?rev=339992&r1=339991&r2=339992&view=diff
==============================================================================
--- libcxx/branches/release_70/test/support/test_macros.h (original)
+++ libcxx/branches/release_70/test/support/test_macros.h Fri Aug 17 00:22:08 2018
@@ -124,22 +124,29 @@
 
 // Sniff out to see if the underling C library has C11 features
 // Note that at this time (July 2018), MacOS X and iOS do NOT.
+// This is cribbed from __config; but lives here as well because we can't assume libc++
 #if __ISO_C_VISIBLE >= 2011 || TEST_STD_VER >= 11
 #  if defined(__FreeBSD__)
+//  Specifically, FreeBSD does NOT have timespec_get, even though they have all
+//  the rest of C11 - this is PR#38495
 #    define TEST_HAS_C11_FEATURES
 #  elif defined(__Fuchsia__)
 #    define TEST_HAS_C11_FEATURES
+#    define TEST_HAS_TIMESPEC_GET
 #  elif defined(__linux__)
 #    if !defined(_LIBCPP_HAS_MUSL_LIBC)
 #      if _LIBCPP_GLIBC_PREREQ(2, 17)
+#        define TEST_HAS_TIMESPEC_GET
 #        define TEST_HAS_C11_FEATURES
 #      endif
 #    else // defined(_LIBCPP_HAS_MUSL_LIBC)
 #      define TEST_HAS_C11_FEATURES
+#      define TEST_HAS_TIMESPEC_GET
 #    endif
 #  elif defined(_WIN32)
 #    if defined(_MSC_VER) && !defined(__MINGW32__)
 #      define TEST_HAS_C11_FEATURES // Using Microsoft's C Runtime library
+#      define TEST_HAS_TIMESPEC_GET
 #    endif
 #  endif
 #endif




More information about the cfe-commits mailing list