2011-04-14 12:25:17 +00:00
|
|
|
#if defined _WIN32 || defined __CYGWIN__
|
|
|
|
# define PUBLIC __attribute__((dllexport))
|
|
|
|
# define PRIVATE
|
|
|
|
#else
|
|
|
|
# define PUBLIC __attribute__ ((visibility("default")))
|
|
|
|
# define PRIVATE __attribute__ ((visibility("hidden")))
|
|
|
|
#endif
|
2011-04-14 16:44:34 +00:00
|
|
|
#ifdef NO_LEGACY
|
|
|
|
# define LEGACY PRIVATE
|
|
|
|
#else
|
|
|
|
# define LEGACY PUBLIC
|
|
|
|
#endif
|
2011-04-14 12:25:17 +00:00
|
|
|
|
2011-05-22 23:02:04 +00:00
|
|
|
#if defined(DEBUG) || (!defined(__clang__))
|
|
|
|
# include <assert.h>
|
|
|
|
# define UNREACHABLE(x) assert(0 && x)
|
|
|
|
# define ASSERT(x) assert(x)
|
|
|
|
#else
|
|
|
|
# define UNREACHABLE(x) __builtin_unreachable()
|
|
|
|
# define ASSERT(x) do { if (x) __builtin_unreachable(); } while(0)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#define LIKELY(x) __builtin_expect(x, 1)
|
|
|
|
#define UNLIKELY(x) __builtin_expect(x, 0)
|