freebsd-ports/multimedia/vlc/files/patch-include_vlc__atomic.h
Thomas Zander d9a4fd5cae Fix build with libc++ 3.8.0
VLC brings its own header for atomic operations which defines a whole
bunch of atomic macros, conflicting with the ones in the C++ standard
<atomic> header. This changeset works around those.

PR:		209722
Submitted by:	dim
2016-06-01 06:17:51 +00:00

17 lines
401 B
C++

--- include/vlc_atomic.h.orig 2014-08-14 07:20:03 UTC
+++ include/vlc_atomic.h
@@ -32,6 +32,14 @@
/*** Native C11 atomics ***/
# include <stdatomic.h>
+# elif defined (__cplusplus) && defined(_LIBCPP_VERSION) && _LIBCPP_VERSION >= 3800
+
+# include <atomic>
+
+using std::atomic_uint_least32_t;
+using std::atomic_uintptr_t;
+using std::atomic_int;
+
# else
# define ATOMIC_FLAG_INIT false