Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 1 | #ifndef _LINUX_CONST_H |
| 2 | #define _LINUX_CONST_H |
| 3 | |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 4 | #include <vdso/const.h> |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 5 | |
Olivier Deprez | 157378f | 2022-04-04 15:47:50 +0200 | [diff] [blame^] | 6 | /* |
| 7 | * This returns a constant expression while determining if an argument is |
| 8 | * a constant expression, most importantly without evaluating the argument. |
| 9 | * Glory to Martin Uecker <Martin.Uecker@med.uni-goettingen.de> |
| 10 | */ |
| 11 | #define __is_constexpr(x) \ |
| 12 | (sizeof(int) == sizeof(*(8 ? ((void *)((long)(x) * 0l)) : (int *)8))) |
Andrew Scull | b4b6d4a | 2019-01-02 15:54:55 +0000 | [diff] [blame] | 13 | |
| 14 | #endif /* _LINUX_CONST_H */ |