Go to the documentation of this file. 1 #ifndef HAWKTRACER_MACROS_H 2 #define HAWKTRACER_MACROS_H 4 #include <hawktracer/ht_config.h> 7 #define HT_UNUSED(x) (void)(x) 16 # define HT_DECLS_BEGIN extern "C" { 17 # define HT_DECLS_END } 19 # define HT_DECLS_BEGIN 23 #if (defined(__cplusplus) && __cplusplus >= 201103L) || (defined(_MSVC_LANG) && _MSVC_LANG >= 201402L) 39 #if defined(__GNUC__) && (__GNUC__ > 2) && defined(__OPTIMIZE__) 40 # define HT_LIKELY(expression) (__builtin_expect ((expression), 1)) 41 # define HT_UNLIKELY(expression) (__builtin_expect ((expression), 0)) 43 # define HT_LIKELY(expr) (expr) 44 # define HT_UNLIKELY(expr) (expr) 51 # if defined (_MSC_VER) && (_MSC_VER < 1900) 52 # define HT_INLINE __inline 53 # elif !defined(__STDC_VERSION__) || (__STDC_VERSION__ < 199900) 54 # define HT_INLINE __inline 56 # define HT_INLINE inline 59 # define HT_INLINE inline 63 # define HT_PLATFORM_WIN32 69 #if defined(HT_PLATFORM_WIN32) && !defined(HT_COMPILE_STATIC) 70 # if defined(HT_COMPILE_SHARED_EXPORT) 71 # define HT_API __declspec(dllexport) 73 # define HT_API __declspec(dllimport) 79 #define HT_MACRO_CONCAT_(x, y) x ## y 82 #define HT_MACRO_CONCAT(x, y) HT_MACRO_CONCAT_(x, y) 85 #define HT_UNIQUE_VAR_NAME(BASE_VAR_NAME) HT_MACRO_CONCAT(BASE_VAR_NAME, __LINE__) 92 # define HT_THREAD_LOCAL thread_local 93 #elif __STDC_VERSION__ >= 201112 && !defined __STDC_NO_THREADS__ 94 # define HT_THREAD_LOCAL _Thread_local 95 #elif defined _WIN32 && ( defined _MSC_VER || defined __ICL || defined __DMC__ || defined __BORLANDC__ ) 96 # define HT_THREAD_LOCAL __declspec(thread) 97 #elif defined __GNUC__ || defined __SUNPRO_C || defined __xlC__ 98 # define HT_THREAD_LOCAL __thread 101 #if defined(HT_HAVE_UNISTD_H) || (defined(__unix__) || (defined(__APPLE__) && defined(__MACH__))) 102 # define HT_HAVE_UNISTD_H