[libcxx-commits] [libcxx] 5571467 - [libc++] Avoid including <sys/cdefs.h> on non-Apple platforms in <ctime>

Louis Dionne via libcxx-commits libcxx-commits at lists.llvm.org
Wed Sep 2 15:12:04 PDT 2020


Author: Louis Dionne
Date: 2020-09-02T18:11:26-04:00
New Revision: 55714678796c8fc456866add2841f3dd282e5392

URL: https://github.com/llvm/llvm-project/commit/55714678796c8fc456866add2841f3dd282e5392
DIFF: https://github.com/llvm/llvm-project/commit/55714678796c8fc456866add2841f3dd282e5392.diff

LOG: [libc++] Avoid including <sys/cdefs.h> on non-Apple platforms in <ctime>

Added: 
    

Modified: 
    libcxx/include/ctime

Removed: 
    


################################################################################
diff  --git a/libcxx/include/ctime b/libcxx/include/ctime
index 3aa619daa358..b0e6c65af5d5 100644
--- a/libcxx/include/ctime
+++ b/libcxx/include/ctime
@@ -59,9 +59,11 @@ int timespec_get( struct timespec *ts, int base); // C++17
 // we're detecting this here instead of in <__config> because we can't include
 // system headers from <__config>, since it leads to circular module dependencies.
 // This is also meant to be a very temporary workaround until the SDKs are fixed.
-#include <sys/cdefs.h>
-#if defined(__APPLE__) && defined(_LIBCPP_HAS_TIMESPEC_GET) && (__DARWIN_C_LEVEL < __DARWIN_C_FULL)
-#  define _LIBCPP_HAS_TIMESPEC_GET_NOT_ACTUALLY_PROVIDED
+#if defined(__APPLE__)
+#   include <sys/cdefs.h>
+#   if defined(_LIBCPP_HAS_TIMESPEC_GET) && (__DARWIN_C_LEVEL < __DARWIN_C_FULL)
+#       define _LIBCPP_HAS_TIMESPEC_GET_NOT_ACTUALLY_PROVIDED
+#   endif
 #endif
 
 _LIBCPP_BEGIN_NAMESPACE_STD


        


More information about the libcxx-commits mailing list