Build: Define THREAD_LOCAL even if !WITH_TURBOJPEG
The SIMD dispatchers use thread-local storage now as well, because of
f579cc11b3.
This commit is contained in:
@@ -468,19 +468,17 @@ if(NOT INLINE_WORKS)
|
||||
endif()
|
||||
message(STATUS "INLINE = ${INLINE} (FORCE_INLINE = ${FORCE_INLINE})")
|
||||
|
||||
if(WITH_TURBOJPEG)
|
||||
if(MSVC)
|
||||
set(THREAD_LOCAL "__declspec(thread)")
|
||||
else()
|
||||
set(THREAD_LOCAL "__thread")
|
||||
endif()
|
||||
check_c_source_compiles("${THREAD_LOCAL} int i; int main(void) { i = 0; return i; }" HAVE_THREAD_LOCAL)
|
||||
if(HAVE_THREAD_LOCAL)
|
||||
message(STATUS "THREAD_LOCAL = ${THREAD_LOCAL}")
|
||||
else()
|
||||
message(WARNING "Thread-local storage is not available. The TurboJPEG API library's global error handler will not be thread-safe.")
|
||||
unset(THREAD_LOCAL)
|
||||
endif()
|
||||
if(MSVC)
|
||||
set(THREAD_LOCAL "__declspec(thread)")
|
||||
else()
|
||||
set(THREAD_LOCAL "__thread")
|
||||
endif()
|
||||
check_c_source_compiles("${THREAD_LOCAL} int i; int main(void) { i = 0; return i; }" HAVE_THREAD_LOCAL)
|
||||
if(HAVE_THREAD_LOCAL)
|
||||
message(STATUS "THREAD_LOCAL = ${THREAD_LOCAL}")
|
||||
else()
|
||||
message(WARNING "Thread-local storage is not available. The TurboJPEG API library's global error handler will not be thread-safe.")
|
||||
unset(THREAD_LOCAL)
|
||||
endif()
|
||||
|
||||
if(UNIX AND NOT APPLE)
|
||||
|
||||
Reference in New Issue
Block a user