summaryrefslogtreecommitdiff
path: root/common/rt/include/rt_common.h
diff options
context:
space:
mode:
Diffstat (limited to 'common/rt/include/rt_common.h')
-rw-r--r--common/rt/include/rt_common.h23
1 files changed, 23 insertions, 0 deletions
diff --git a/common/rt/include/rt_common.h b/common/rt/include/rt_common.h
new file mode 100644
index 0000000..8df8766
--- /dev/null
+++ b/common/rt/include/rt_common.h
@@ -0,0 +1,23 @@
+#ifndef __RT_COMMON_H__
+#define __RT_COMMON_H__
+
+#include <assert.h>
+#define EVAL_TM_STYLE "%Y-%m-%d"
+
+/** Alway treated the expr as true */
+#ifndef likely
+#define likely(expr) __builtin_expect(!!(expr), 1)
+#endif
+
+/** Alway treated the expr as false */
+#ifndef unlikely
+#define unlikely(expr) __builtin_expect(!!(expr), 0)
+#endif
+
+#define __rt_always_inline__ __attribute__((always_inline)) inline
+
+#define CHECK_OR_EXIT(condition, fmt, ...) \
+do { if(!(condition)) { mesa_runtime_log(RLOG_LV_FATAL, MODULE_NAME, fmt, ##__VA_ARGS__); exit(EXIT_FAILURE); } } while(0) \
+
+
+#endif