File tree Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Expand file tree Collapse file tree 2 files changed +18
-18
lines changed Original file line number Diff line number Diff line change 39
39
#endif
40
40
#endif
41
41
42
- /*
43
- * Thread local variables are declared with different keywords depending on
44
- * which C/C++ standard that is used. C++11 and C23 uses "thread_local" whilst
45
- * C11 uses "_Thread_local". Previously the GNU "__thread" keyword was used
46
- * which is the same in both gcc and g++.
47
- */
48
- #ifndef Z_THREAD_LOCAL
49
- #if defined(__cplusplus ) && (__cplusplus ) >= 201103L /* C++11 */
50
- #define Z_THREAD_LOCAL thread_local
51
- #elif defined(__STDC_VERSION__ ) && (__STDC_VERSION__ ) >= 202311L /* C23 */
52
- #define Z_THREAD_LOCAL thread_local
53
- #elif defined(__STDC_VERSION__ ) && (__STDC_VERSION__ ) >= 201112L /* C11 */
54
- #define Z_THREAD_LOCAL _Thread_local
55
- #else /* Default back to old behavior which used the GNU keyword. */
56
- #define Z_THREAD_LOCAL __thread
57
- #endif
58
- #endif /* Z_THREAD_LOCAL */
59
-
60
42
/*
61
43
* Generate a reference to an external symbol.
62
44
* The reference indicates to the linker that the symbol is required
Original file line number Diff line number Diff line change @@ -29,6 +29,24 @@ typedef union {
29
29
void (* thepfunc )(void );
30
30
} z_max_align_t ;
31
31
32
+ /*
33
+ * Thread local variables are declared with different keywords depending on
34
+ * which C/C++ standard that is used. C++11 and C23 uses "thread_local" whilst
35
+ * C11 uses "_Thread_local". Previously the GNU "__thread" keyword was used
36
+ * which is the same in both gcc and g++.
37
+ */
38
+ #ifndef Z_THREAD_LOCAL
39
+ #if defined(__cplusplus ) && (__cplusplus ) >= 201103L /* C++11 */
40
+ #define Z_THREAD_LOCAL thread_local
41
+ #elif defined(__STDC_VERSION__ ) && (__STDC_VERSION__ ) >= 202311L /* C23 */
42
+ #define Z_THREAD_LOCAL thread_local
43
+ #elif defined(__STDC_VERSION__ ) && (__STDC_VERSION__ ) >= 201112L /* C11 */
44
+ #define Z_THREAD_LOCAL _Thread_local
45
+ #else /* Default back to old behavior which used the GNU keyword. */
46
+ #define Z_THREAD_LOCAL __thread
47
+ #endif
48
+ #endif /* Z_THREAD_LOCAL */
49
+
32
50
#ifdef __cplusplus
33
51
/* Zephyr requires an int main(void) signature with C linkage for the application main if present */
34
52
extern int main (void );
You can’t perform that action at this time.
0 commit comments