summaryrefslogtreecommitdiff
path: root/c/call_python.c
diff options
context:
space:
mode:
authorArmin Rigo <arigo@tunes.org>2017-01-02 20:53:43 +0100
committerArmin Rigo <arigo@tunes.org>2017-01-02 20:53:43 +0100
commitccd9d175280afa7b0d1661cae043497d42fbd0d2 (patch)
treee9582ddb6ac8d08a98d5d86718fb580ae889214f /c/call_python.c
parent60cae1236a51f8c86a1020a649f3db5a44078057 (diff)
downloadcffi-ccd9d175280afa7b0d1661cae043497d42fbd0d2.tar.gz
support more obscure compilers. source is https://github.com/matricks/bam/pull/61/files
Diffstat (limited to 'c/call_python.c')
-rw-r--r--c/call_python.c15
1 files changed, 14 insertions, 1 deletions
diff --git a/c/call_python.c b/c/call_python.c
index d0419de..ecff127 100644
--- a/c/call_python.c
+++ b/c/call_python.c
@@ -177,7 +177,20 @@ static int _update_cache_to_call_python(struct _cffi_externpy_s *externpy)
#if (defined(WITH_THREAD) && !defined(_MSC_VER) && \
!defined(__amd64__) && !defined(__x86_64__) && \
!defined(__i386__) && !defined(__i386))
-# define read_barrier() __sync_synchronize()
+# if defined(__GNUC__)
+# define read_barrier() __sync_synchronize()
+# elif defined(_AIX)
+# define read_barrier() __lwsync()
+# elif defined(__SUNPRO_C) || defined(__SUNPRO_CC)
+# include <mbarrier.h>
+# define read_barrier() __compiler_barrier()
+# elif defined(__hpux)
+# define read_barrier() _Asm_mf()
+# else
+# define read_barrier() /* missing */
+# warning "no definition for read_barrier(), missing synchronization for\
+ multi-thread initialization in embedded mode"
+# endif
#else
# define read_barrier() (void)0
#endif