From d79c8ef92f523462808ff7e5c2467716666582ae Mon Sep 17 00:00:00 2001 From: LIU Hao Date: Fri, 29 Dec 2023 15:00:10 +0800 Subject: [PATCH] thread: Move a declaration into `#if` block where it is used --- mcfgthread/thread.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mcfgthread/thread.h b/mcfgthread/thread.h index 0730f05df6..c06fef4d7e 100644 --- a/mcfgthread/thread.h +++ b/mcfgthread/thread.h @@ -293,7 +293,6 @@ uint32_t _MCF_thread_self_tid(void) __MCF_NOEXCEPT { uint32_t __tid; - char* __teb __attribute__((__unused__)); #if defined(__amd64__) /* Current TEB starts at `gs:0`. */ __asm__ ("{ movl %%gs:0x48, %0 | mov %0, dword ptr gs:[0x48] }" : "=r"(__tid)); @@ -305,6 +304,7 @@ _MCF_thread_self_tid(void) __MCF_NOEXCEPT __asm__ ("ldr %w0, [x18, #0x48]" : "=r"(__tid)); #elif defined(__arm__) /* Current TEB base is moved from co-processor p15. */ + char* __teb; __asm__ ("mrc p15, #0, %0, c13, c0, #2" : "=r"(__teb)); __tid = *(uint32_t*) (__teb + 0x24); #else