[libcxx-commits] [libcxx] 9abff04 - [libc++] Fix test_macros.h in the same way as commit 49e5a896 fixed __config.

Arthur O'Dwyer via libcxx-commits libcxx-commits at lists.llvm.org
Sun Apr 4 15:09:21 PDT 2021


Author: Arthur O'Dwyer
Date: 2021-04-04T18:08:19-04:00
New Revision: 9abff04e506fe0b86485909434d4dc3b6011c463

URL: https://github.com/llvm/llvm-project/commit/9abff04e506fe0b86485909434d4dc3b6011c463
DIFF: https://github.com/llvm/llvm-project/commit/9abff04e506fe0b86485909434d4dc3b6011c463.diff

LOG: [libc++] Fix test_macros.h in the same way as commit 49e5a896 fixed __config.

Since D99515, this header triggers -Wundef on Mac OSX older than 10.15.
This is now fixed.

Added: 
    

Modified: 
    libcxx/test/support/test_macros.h

Removed: 
    


################################################################################
diff  --git a/libcxx/test/support/test_macros.h b/libcxx/test/support/test_macros.h
index a82b434e036e8..f4d3ab60807c4 100644
--- a/libcxx/test/support/test_macros.h
+++ b/libcxx/test/support/test_macros.h
@@ -215,10 +215,10 @@
 #  elif defined(__APPLE__)
      // timespec_get and aligned_alloc were introduced in macOS 10.15 and
      // aligned releases
-#    if (__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101500 || \
-         __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130000 || \
-         __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 130000 || \
-         __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 60000)
+#    if ((defined(__ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_MAC_OS_X_VERSION_MIN_REQUIRED__ >= 101500) || \
+         (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__ >= 130000) || \
+         (defined(__ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_TV_OS_VERSION_MIN_REQUIRED__ >= 130000) || \
+         (defined(__ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__) && __ENVIRONMENT_WATCH_OS_VERSION_MIN_REQUIRED__ >= 60000))
 #      define TEST_HAS_ALIGNED_ALLOC
 #      define TEST_HAS_TIMESPEC_GET
 #    endif


        


More information about the libcxx-commits mailing list