mehdi_amini created this revision.
mehdi_amini added a reviewer: rsmith.
mehdi_amini added a subscriber: cfe-commits.

This solved compiling:

  #include <stdatomic.h>
  #include <atomic>


https://reviews.llvm.org/D26376

Files:
  libcxx/include/atomic


Index: libcxx/include/atomic
===================================================================
--- libcxx/include/atomic
+++ libcxx/include/atomic
@@ -560,6 +560,63 @@
 # define __cpp_lib_atomic_is_always_lock_free 201603L
 #endif
 
+// stdatomic.h may implement these as a macros, be safe and undef.
+#ifdef kill_dependency
+#undef kill_dependency
+#endif
+#ifdef atomic_is_lock_free
+#undef atomic_is_lock_free
+#endif
+#ifdef atomic_load
+#undef atomic_load
+#endif
+#ifdef atomic_exchange
+#undef atomic_exchange
+#endif
+#ifdef atomic_compare_exchange_weak
+#undef atomic_compare_exchange_weak
+#endif
+#ifdef atomic_compare_exchange_strong
+#undef atomic_compare_exchange_strong
+#endif
+#ifdef atomic_fetch_and
+#undef atomic_fetch_and
+#endif
+#ifdef atomic_fetch_add
+#undef atomic_fetch_add
+#endif
+#ifdef atomic_fetch_sub
+#undef atomic_fetch_sub
+#endif
+#ifdef atomic_store
+#undef atomic_store
+#endif
+#ifdef atomic_store_explicit
+#undef atomic_store_explicit
+#endif
+#ifdef atomic_flag_test_and_set
+#undef atomic_flag_test_and_set
+#endif
+#ifdef atomic_flag_test_and_set_explicit
+#undef atomic_flag_test_and_set_explicit
+#endif
+#ifdef atomic_exchange_explicit
+#undef atomic_exchange_explicit
+#endif
+#ifdef atomic_flag_clear
+#undef atomic_flag_clear
+#endif
+#ifdef atomic_fetch_xor
+#undef atomic_fetch_xor
+#endif
+#ifdef atomic_flag_clear_explicit
+#undef atomic_flag_clear_explicit
+#endif
+#ifdef atomic_fetch_or
+#undef atomic_fetch_or
+#endif
+
+
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 typedef enum memory_order


Index: libcxx/include/atomic
===================================================================
--- libcxx/include/atomic
+++ libcxx/include/atomic
@@ -560,6 +560,63 @@
 # define __cpp_lib_atomic_is_always_lock_free 201603L
 #endif
 
+// stdatomic.h may implement these as a macros, be safe and undef.
+#ifdef kill_dependency
+#undef kill_dependency
+#endif
+#ifdef atomic_is_lock_free
+#undef atomic_is_lock_free
+#endif
+#ifdef atomic_load
+#undef atomic_load
+#endif
+#ifdef atomic_exchange
+#undef atomic_exchange
+#endif
+#ifdef atomic_compare_exchange_weak
+#undef atomic_compare_exchange_weak
+#endif
+#ifdef atomic_compare_exchange_strong
+#undef atomic_compare_exchange_strong
+#endif
+#ifdef atomic_fetch_and
+#undef atomic_fetch_and
+#endif
+#ifdef atomic_fetch_add
+#undef atomic_fetch_add
+#endif
+#ifdef atomic_fetch_sub
+#undef atomic_fetch_sub
+#endif
+#ifdef atomic_store
+#undef atomic_store
+#endif
+#ifdef atomic_store_explicit
+#undef atomic_store_explicit
+#endif
+#ifdef atomic_flag_test_and_set
+#undef atomic_flag_test_and_set
+#endif
+#ifdef atomic_flag_test_and_set_explicit
+#undef atomic_flag_test_and_set_explicit
+#endif
+#ifdef atomic_exchange_explicit
+#undef atomic_exchange_explicit
+#endif
+#ifdef atomic_flag_clear
+#undef atomic_flag_clear
+#endif
+#ifdef atomic_fetch_xor
+#undef atomic_fetch_xor
+#endif
+#ifdef atomic_flag_clear_explicit
+#undef atomic_flag_clear_explicit
+#endif
+#ifdef atomic_fetch_or
+#undef atomic_fetch_or
+#endif
+
+
 _LIBCPP_BEGIN_NAMESPACE_STD
 
 typedef enum memory_order
_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to