Skip to content

Commit d6e3fe1

Browse files
authored
avoid unused function warning in pico_thread_local (#2948)
1 parent 4a5cd4c commit d6e3fe1

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

src/rp2_common/pico_thread_local/thread_local.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ static uint32_t _emutls_size;
8080
static uint32_t _emutls_align;
8181
#endif
8282

83+
#if PICO_THREAD_LOCAL_PROVIDE_INIT_TLS
8384
// fill a linear region with data from the tls metadata (either emutls objects or tdata/tbss)
8485
static inline void _tls_init_from_emutls_or_tdata(void *tls) {
8586
#if PICO_THREAD_LOCAL_SUPPORT_EMUTLS
@@ -109,7 +110,9 @@ static inline void _tls_init_from_emutls_or_tdata(void *tls) {
109110
#endif
110111
}
111112
#define _INIT_TLS_IMPL _tls_init_from_emutls_or_tdata
113+
#endif
112114

115+
#if PICO_THREAD_LOCAL_PROVIDE_SET_TLS
113116
static inline void _set_tls_per_thread(void *tls) {
114117
assert(tls); // we should never be setting 0
115118
#if !PICO_THREAD_LOCAL_THREAD_POINTER_VIA_RISCV_REG
@@ -119,6 +122,7 @@ static inline void _set_tls_per_thread(void *tls) {
119122
#endif
120123
}
121124
#define _SET_TLS_IMPL _set_tls_per_thread
125+
#endif
122126

123127
#if PICO_THREAD_LOCAL_SUPPORT_THREAD_POINTER
124128
static __used void *_init_core_local_tls(void) {

0 commit comments

Comments
 (0)