Remove _tls_used trickery unless needed

This commit is contained in:
Chris Denton 2024-02-24 14:09:22 -03:00
parent 2fc091f510
commit ad4c4f4654
No known key found for this signature in database
GPG key ID: 713472F2F45627DE

View file

@ -295,16 +295,13 @@ unsafe extern "system" fn on_tls_callback(_h: c::LPVOID, dwReason: c::DWORD, _pv
// See comments above for what this is doing. Note that we don't need this
// trickery on GNU windows, just on MSVC.
reference_tls_used();
#[cfg(target_env = "msvc")]
unsafe fn reference_tls_used() {
#[cfg(all(target_env = "msvc", not(target_thread_local)))]
{
extern "C" {
static _tls_used: u8;
}
crate::intrinsics::volatile_load(&_tls_used);
}
#[cfg(not(target_env = "msvc"))]
unsafe fn reference_tls_used() {}
}
#[cfg(not(target_thread_local))]