summaryrefslogtreecommitdiffstats
path: root/src/gallium/include/pipe/p_compiler.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/include/pipe/p_compiler.h')
-rw-r--r--src/gallium/include/pipe/p_compiler.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h
index a14486a5fb5..0358c14e24b 100644
--- a/src/gallium/include/pipe/p_compiler.h
+++ b/src/gallium/include/pipe/p_compiler.h
@@ -60,6 +60,11 @@
#include <stdbool.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+
#if !defined(__HAIKU__) && !defined(__USE_MISC)
typedef unsigned int uint;
typedef unsigned short ushort;
@@ -184,6 +189,25 @@ typedef unsigned char boolean;
#endif
+
+#if defined(__GNUC__)
+
+#define PIPE_READ_WRITE_BARRIER() __asm__("":::"memory")
+
+#elif defined(_MSC_VER)
+
+void _ReadWriteBarrier(void);
+#pragma intrinsic(_ReadWriteBarrier)
+#define PIPE_READ_WRITE_BARRIER() _ReadWriteBarrier()
+
+#else
+
+#warning "Unsupported compiler"
+#define PIPE_READ_WRITE_BARRIER() /* */
+
+#endif
+
+
/* You should use these macros to mark if blocks where the if condition
* is either likely to be true, or unlikely to be true.
*
@@ -224,4 +248,10 @@ typedef unsigned char boolean;
#define unlikely(x) !!(x)
#endif
+
+#if defined(__cplusplus)
+}
+#endif
+
+
#endif /* P_COMPILER_H */