aboutsummaryrefslogtreecommitdiff
path: root/libcxx/utils
diff options
context:
space:
mode:
authorLouis Dionne <ldionne.2@gmail.com>2024-02-05 11:05:46 -0500
committerTom Stellard <tstellar@redhat.com>2024-02-05 11:49:51 -0800
commit72533964036dca3ce806044e92a1e70584e3aca9 (patch)
tree8cf8397a897feaaa3cd6a78b3993730ceebae243 /libcxx/utils
parent47fbb649e12f7016ee60a5918bda26c01f2ea543 (diff)
downloadllvm-72533964036dca3ce806044e92a1e70584e3aca9.zip
llvm-72533964036dca3ce806044e92a1e70584e3aca9.tar.gz
llvm-72533964036dca3ce806044e92a1e70584e3aca9.tar.bz2
[libc++] Add missing conditionals for feature-test macros (#80168)
We noticed that some feature-test macros were not conditional on configuration flags like _LIBCPP_HAS_NO_FILESYSTEM. As a result, code attempting to use FTMs would not work as intended. This patch adds conditionals for a few feature-test macros, but more issues may exist. rdar://122020466 (cherry picked from commit f2c84211d2834c73ff874389c6bb47b1c76d391a)
Diffstat (limited to 'libcxx/utils')
-rwxr-xr-xlibcxx/utils/generate_feature_test_macro_components.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/libcxx/utils/generate_feature_test_macro_components.py b/libcxx/utils/generate_feature_test_macro_components.py
index b7d95d4..9825d4c 100755
--- a/libcxx/utils/generate_feature_test_macro_components.py
+++ b/libcxx/utils/generate_feature_test_macro_components.py
@@ -456,8 +456,8 @@ feature_test_macros = [
"name": "__cpp_lib_filesystem",
"values": {"c++17": 201703},
"headers": ["filesystem"],
- "test_suite_guard": "!defined(_LIBCPP_VERSION) || _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY",
- "libcxx_guard": "_LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY",
+ "test_suite_guard": "!defined(_LIBCPP_VERSION) || (!defined(_LIBCPP_HAS_NO_FILESYSTEM) && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_FILESYSTEM) && _LIBCPP_AVAILABILITY_HAS_FILESYSTEM_LIBRARY",
},
{
"name": "__cpp_lib_format",
@@ -570,6 +570,8 @@ feature_test_macros = [
"name": "__cpp_lib_fstream_native_handle",
"values": {"c++26": 202306}, # P1759R6 Native handles and file streams
"headers": ["fstream"],
+ "test_suite_guard": "!defined(_LIBCPP_VERSION) || (!defined(_LIBCPP_HAS_NO_FILESYSTEM) && !defined(_LIBCPP_HAS_NO_LOCALIZATION))",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_FILESYSTEM) && !defined(_LIBCPP_HAS_NO_LOCALIZATION)",
},
{
"name": "__cpp_lib_function_ref",
@@ -879,6 +881,8 @@ feature_test_macros = [
"name": "__cpp_lib_quoted_string_io",
"values": {"c++14": 201304},
"headers": ["iomanip"],
+ "test_suite_guard": "!defined(_LIBCPP_VERSION) || !defined(_LIBCPP_HAS_NO_LOCALIZATION)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_LOCALIZATION)",
},
{
"name": "__cpp_lib_ranges",
@@ -1016,6 +1020,8 @@ feature_test_macros = [
"name": "__cpp_lib_scoped_lock",
"values": {"c++17": 201703},
"headers": ["mutex"],
+ "test_suite_guard": "!defined(_LIBCPP_HAS_NO_THREADS)",
+ "libcxx_guard": "!defined(_LIBCPP_HAS_NO_THREADS)",
},
{
"name": "__cpp_lib_semaphore",