Skip to content

Commit

Permalink
check for __has_feature
Browse files Browse the repository at this point in the history
  • Loading branch information
daschuer authored Nov 14, 2024
1 parent d3d6809 commit 3def94f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion lib/portaudio/pa_memorybarrier.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,13 @@
*
****************/

#if (__has_feature(thread_sanitizer) || defined(__SANITIZE_THREAD__)) && __has_include(<sanitizer/tsan_interface_atomic.h>)
#ifdef __has_feature
#if __has_feature(thread_sanitizer)
# define __SANITIZE_THREAD__ 1
#endif
#endif

#if defined(__SANITIZE_THREAD__) && __has_include(<sanitizer/tsan_interface_atomic.h>)
# include <sanitizer/tsan_interface_atomic.h>
# warning Building under Thread Sanitizer!
# define PaUtil_FullMemoryBarrier() __tsan_atomic_thread_fence(__tsan_memory_order_seq_cst)
Expand Down

0 comments on commit 3def94f

Please sign in to comment.