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 3939#endif
4040#endif
4141
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-
6042/*
6143 * Generate a reference to an external symbol.
6244 * 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 {
2929 void (* thepfunc )(void );
3030} z_max_align_t ;
3131
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+
3250#ifdef __cplusplus
3351/* Zephyr requires an int main(void) signature with C linkage for the application main if present */
3452extern int main (void );
You can’t perform that action at this time.
0 commit comments