[libcxx-commits] [pstl] 64748ef - [libc++] Use _LIBCPP_ASSERT by default for _PSTL_ASSERTions

Nikolas Klauser via libcxx-commits libcxx-commits at lists.llvm.org
Fri May 20 07:59:02 PDT 2022


Author: Nikolas Klauser
Date: 2022-05-20T16:58:21+02:00
New Revision: 64748efc27406244496e0c2ee6714e76b794c277

URL: https://github.com/llvm/llvm-project/commit/64748efc27406244496e0c2ee6714e76b794c277
DIFF: https://github.com/llvm/llvm-project/commit/64748efc27406244496e0c2ee6714e76b794c277.diff

LOG: [libc++] Use _LIBCPP_ASSERT by default for _PSTL_ASSERTions

Reviewed By: ldionne, #libc

Spies: jwakely, rodgert, libcxx-commits

Differential Revision: https://reviews.llvm.org/D125634

Added: 
    

Modified: 
    pstl/include/pstl/internal/pstl_config.h

Removed: 
    


################################################################################
diff  --git a/pstl/include/pstl/internal/pstl_config.h b/pstl/include/pstl/internal/pstl_config.h
index 80a1f9a882bb2..ad0cb5d312b47 100644
--- a/pstl/include/pstl/internal/pstl_config.h
+++ b/pstl/include/pstl/internal/pstl_config.h
@@ -27,7 +27,12 @@
 #    define _PSTL_USAGE_WARNINGS
 #endif
 
-#if !defined(_PSTL_ASSERT)
+#if defined(_LIBCPP_VERSION)
+#    include <__assert>
+#    define _PSTL_ASSERT(pred) _LIBCPP_ASSERT(pred, "")
+#elif defined(__GLIBCXX__)
+#    define _PSTL_ASSERT(pred) __glibcxx_assert(pred)
+#else
 #    include <cassert>
 #    define _PSTL_ASSERT(pred) (assert((pred)))
 #endif


        


More information about the libcxx-commits mailing list