summaryrefslogtreecommitdiffstats
path: root/src/mapi/u_compiler.h
diff options
context:
space:
mode:
authorMatt Turner <[email protected]>2013-01-21 10:27:25 -0800
committerMatt Turner <[email protected]>2013-04-15 12:04:25 -0700
commitd5e9426b9605264608e0b1204ebf818103f1f011 (patch)
tree3031ccdbd85b35529129f5cef87c8779be5f8782 /src/mapi/u_compiler.h
parent3c690524e2ec0fdd6bef6d50897d6879fdb8b53b (diff)
build: Move src/mapi/mapi/* to src/mapi/
Tested-by: Emil Velikov <[email protected]> Reviewed-and-Tested-by: Andreas Boll <[email protected]> Reviewed-by: Jordan Justen <[email protected]>
Diffstat (limited to 'src/mapi/u_compiler.h')
-rw-r--r--src/mapi/u_compiler.h33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/mapi/u_compiler.h b/src/mapi/u_compiler.h
new file mode 100644
index 00000000000..f376e97a0f3
--- /dev/null
+++ b/src/mapi/u_compiler.h
@@ -0,0 +1,33 @@
+#ifndef _U_COMPILER_H_
+#define _U_COMPILER_H_
+
+#include "c99_compat.h" /* inline, __func__, etc. */
+
+
+/* XXX: Use standard `inline` keyword instead */
+#ifndef INLINE
+# define INLINE inline
+#endif
+
+/* Function visibility */
+#ifndef PUBLIC
+# if defined(__GNUC__) || (defined(__SUNPRO_C) && (__SUNPRO_C >= 0x590))
+# define PUBLIC __attribute__((visibility("default")))
+# elif defined(_MSC_VER)
+# define PUBLIC __declspec(dllexport)
+# else
+# define PUBLIC
+# endif
+#endif
+
+#ifndef likely
+# if defined(__GNUC__)
+# define likely(x) __builtin_expect(!!(x), 1)
+# define unlikely(x) __builtin_expect(!!(x), 0)
+# else
+# define likely(x) (x)
+# define unlikely(x) (x)
+# endif
+#endif
+
+#endif /* _U_COMPILER_H_ */