Move the TinyCC/Windows ARM64 Interlocked workaround from the semlock call site into the bundled WinAPI header. This keeps tcc.h using the normal Interlocked API while avoiding unresolved Interlocked imports when tcc -run self-compiles on Windows ARM64. Update lib/bt-exe.c as well so its ARM64 runtime object does not define a second InterlockedExchange fallback now provided by winnt.h.
Showing the changes to lib (1 of 7 files). Show all
Unified · Split
| @@ -85,13 +85,3 @@ ST_FUNC char *pstrcpy(char *buf, size_t buf_size, const char *s) · 84 unmodified lines | |||
| 85 | buf[l] = 0; | 85 | buf[l] = 0; |
| 86 | return buf; | 86 | return buf; |
| 87 | } | 87 | } |
| 88 | |||
| 89 | #if defined(_WIN64) && defined(__aarch64__) | ||
| 90 | /* The bt-only Windows ARM64 build should not rely on importing this helper. */ | ||
| 91 | LONG InterlockedExchange(LONG volatile *Target, LONG Value) | ||
| 92 | { | ||
| 93 | LONG Old = *Target; | ||
| 94 | *Target = Value; | ||
| 95 | return Old; | ||
| 96 | } | ||
| 97 | #endif | ||