File tree 2 files changed +14
-4
lines changed
2 files changed +14
-4
lines changed Original file line number Diff line number Diff line change 31
31
#include <unistd.h>
32
32
#endif
33
33
34
+ // static_assert should be a #define, but if it's not,
35
+ // fall back to the _Static_assert C11 keyword.
34
36
// if C99 - static_assert is noop
35
37
// ref: https://stackoverflow.com/a/53923785/4039976
36
38
#ifndef static_assert
39
+ #if defined(__STDC_VERSION__) && (__STDC_VERSION__ >= 201100L)
40
+ #define static_assert(cond, msg) _Static_assert(cond, msg)
41
+ #else
37
42
#define static_assert(cond, msg) struct global_scope_noop_trick
38
43
#endif
44
+ #endif
39
45
40
46
#if defined(_MSC_VER)
41
47
// disable "possible loss of data" to avoid hundreds of casts
@@ -112,10 +118,6 @@ typedef void * thread_ret_t;
112
118
#endif
113
119
#endif
114
120
115
- #ifdef __HAIKU__
116
- #define static_assert(cond, msg) _Static_assert(cond, msg)
117
- #endif
118
-
119
121
/*#define GGML_PERF*/
120
122
#define GGML_DEBUG 0
121
123
#define GGML_GELU_FP16
Original file line number Diff line number Diff line change 15
15
#define K_SCALE_SIZE 12
16
16
#endif
17
17
18
+ #ifndef static_assert
19
+ #if defined(__STDC_VERSION__ ) && (__STDC_VERSION__ >= 201100L )
20
+ #define static_assert (cond , msg ) _Static_assert(cond, msg)
21
+ #else
22
+ #define static_assert (cond , msg ) struct global_scope_noop_trick
23
+ #endif
24
+ #endif
25
+
18
26
//
19
27
// Super-block quantization structures
20
28
//
You can’t perform that action at this time.
0 commit comments