We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 57aea8d commit 5e4f457Copy full SHA for 5e4f457
1 file changed
include/prism/compiler/assume.h
@@ -10,12 +10,12 @@
10
* range analysis so it can prune impossible paths. Use it to communicate an
11
* invariant the caller guarantees but that the compiler cannot otherwise prove.
12
*/
13
-#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 202311L /* C23 or later */
14
- #define PRISM_ASSUME(expr_) [[assume(expr_)]]
15
-#elif defined(__clang__)
+#if defined(__clang__)
16
#define PRISM_ASSUME(expr_) __builtin_assume(expr_)
17
#elif defined(_MSC_VER)
18
#define PRISM_ASSUME(expr_) __assume(expr_)
+#elif defined(__GNUC__) && (__GNUC__ >= 13)
+ #define PRISM_ASSUME(expr_) __attribute__((assume(expr_)))
19
#elif defined(__GNUC__)
20
#define PRISM_ASSUME(expr_) ((expr_) ? (void) 0 : __builtin_unreachable())
21
#else
0 commit comments