stubs: fix Windows x86 TLS callback CC violation

Windows x86 requires that the TLS destructor callback uses the "stdcall"
calling convention.  Provide a shim which will adjust the calling
convention and call back into the swift portion of the code code with
the expected calling convention.
This commit is contained in:
Saleem Abdulrasool
2017-09-19 11:27:05 -07:00
parent 8bf538cab1
commit 42c98e63d0
2 changed files with 14 additions and 2 deletions

View File

@@ -101,6 +101,7 @@ internal struct _ThreadLocalStorage {
// Destructor to register with pthreads. Responsible for deallocating any memory
// owned.
@_silgen_name("_swift_stdlib_destroyTLS")
internal func _destroyTLS(_ ptr: UnsafeMutableRawPointer?) {
_sanityCheck(ptr != nil,
"_destroyTLS was called, but with nil...")