[libcxx-commits] [PATCH] D75074: [libc++] Proper fix for libc++'s modulemap after D68480
Louis Dionne via Phabricator via libcxx-commits
libcxx-commits at lists.llvm.org
Mon Feb 24 12:57:34 PST 2020
ldionne created this revision.
ldionne added a reviewer: EricWF.
Herald added subscribers: libcxx-commits, dexonsmith, jkorous.
Herald added a project: libc++.
ldionne added a comment.
Herald added a reviewer: mclow.lists.
mclow.lists accepted this revision.
This revision is now accepted and ready to land.
@EricWF I'm unsure about this change -- I think we might want to keep the `requires` in the modulemap but also get rid of the `#error` behavior.
mclow.lists added a comment.
This looks fine to me.
In libc++, we normally #ifdef out header content instead of #erroring
out when the Standard in use is insufficient for the requirements of
the header.
Repository:
rG LLVM Github Monorepo
https://reviews.llvm.org/D75074
Files:
libcxx/include/barrier
libcxx/include/latch
libcxx/include/module.modulemap
libcxx/include/semaphore
Index: libcxx/include/semaphore
===================================================================
--- libcxx/include/semaphore
+++ libcxx/include/semaphore
@@ -58,9 +58,7 @@
# error <semaphore> is not supported on this single threaded system
#endif
-#if _LIBCPP_STD_VER < 14
-# error <semaphore> is requires C++14 or later
-#endif
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -230,4 +228,6 @@
_LIBCPP_END_NAMESPACE_STD
+#endif // _LIBCPP_STD_VER >= 14
+
#endif //_LIBCPP_SEMAPHORE
Index: libcxx/include/module.modulemap
===================================================================
--- libcxx/include/module.modulemap
+++ libcxx/include/module.modulemap
@@ -232,7 +232,6 @@
export *
}
module barrier {
- requires cplusplus14
header "barrier"
export *
}
@@ -340,7 +339,6 @@
export *
}
module latch {
- requires cplusplus14
header "latch"
export *
}
@@ -411,7 +409,6 @@
export *
}
module semaphore {
- requires cplusplus14
header "semaphore"
export *
}
Index: libcxx/include/latch
===================================================================
--- libcxx/include/latch
+++ libcxx/include/latch
@@ -49,9 +49,7 @@
# error <latch> is not supported on this single threaded system
#endif
-#if _LIBCPP_STD_VER < 14
-# error <latch> requires C++14 or later
-#endif
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -101,4 +99,6 @@
_LIBCPP_END_NAMESPACE_STD
+#endif // _LIBCPP_STD_VER >= 14
+
#endif //_LIBCPP_LATCH
Index: libcxx/include/barrier
===================================================================
--- libcxx/include/barrier
+++ libcxx/include/barrier
@@ -57,9 +57,7 @@
# error <barrier> is not supported on this single threaded system
#endif
-#if _LIBCPP_STD_VER < 14
-# error <barrier> requires C++14 or later
-#endif
+#if _LIBCPP_STD_VER >= 14
_LIBCPP_BEGIN_NAMESPACE_STD
@@ -319,4 +317,6 @@
_LIBCPP_END_NAMESPACE_STD
+#endif // _LIBCPP_STD_VER >= 14
+
#endif //_LIBCPP_BARRIER
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D75074.246283.patch
Type: text/x-patch
Size: 2047 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/libcxx-commits/attachments/20200224/1ae09f92/attachment-0001.bin>
More information about the libcxx-commits
mailing list