summaryrefslogtreecommitdiffstats
path: root/include/linux/const.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/const.h')
-rw-r--r--include/linux/const.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/linux/const.h b/include/linux/const.h
new file mode 100644
index 000000000..435ddd72d
--- /dev/null
+++ b/include/linux/const.h
@@ -0,0 +1,14 @@
+#ifndef _LINUX_CONST_H
+#define _LINUX_CONST_H
+
+#include <vdso/const.h>
+
+/*
+ * This returns a constant expression while determining if an argument is
+ * a constant expression, most importantly without evaluating the argument.
+ * Glory to Martin Uecker <Martin.Uecker@med.uni-goettingen.de>
+ */
+#define __is_constexpr(x) \
+ (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8)))
+
+#endif /* _LINUX_CONST_H */