diff options
author | Campbell Barton <campbell@blender.org> | 2022-09-26 05:26:48 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-09-27 00:05:13 +0300 |
commit | bcb7b119ae5240632b7f8b07f926c230f3c48daf (patch) | |
tree | e2ad3dc3fe145f4506c9178d8652bdb0752a55e4 /source/blender/blenlib/intern | |
parent | cd7e9a1ad5b4f60934c4d95d81968788331db94a (diff) |
Cleanup: remove workarounds and version checks for unsupported compilers
Match minimum supported versions from the WIKI [0] by raising them to:
- GCC 9.3.1
- CLANG 8.0
- MVCS 2019 (16.9.16 / 1928)
Details:
- Add CMake checks that ensure supported compiler versions early on.
- Previously GCC per-processor version checks served to exclude
`__clang__`, in some cases this has been replaced by explicitly
excluding `__clang__`. This was needed as CLANG treated some of these
flags differently to GCC, causing the build to fail.
- Remove USE_APPLE_OMP_FIX GCC-4.2 OpenMP workaround.
- Remove linking error workaround for old MSVC versions.
[0]: https://wiki.blender.org/wiki/Building_Blender
Reviewed by: brecht, LazyDodo
Ref D16068
Diffstat (limited to 'source/blender/blenlib/intern')
-rw-r--r-- | source/blender/blenlib/intern/threads.cc | 28 |
1 files changed, 1 insertions, 27 deletions
diff --git a/source/blender/blenlib/intern/threads.cc b/source/blender/blenlib/intern/threads.cc index 156f2a7b338..f99a27c2475 100644 --- a/source/blender/blenlib/intern/threads.cc +++ b/source/blender/blenlib/intern/threads.cc @@ -37,17 +37,6 @@ #include "atomic_ops.h" -#if defined(__APPLE__) && defined(_OPENMP) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2) && \ - !defined(__clang__) -# define USE_APPLE_OMP_FIX -#endif - -#ifdef USE_APPLE_OMP_FIX -/* ************** libgomp (Apple gcc 4.2.1) TLS bug workaround *************** */ -extern pthread_key_t gomp_tls_key; -static void *thread_tls_data; -#endif - /** * Basic Thread Control API * ======================== @@ -153,15 +142,7 @@ void BLI_threadpool_init(ListBase *threadbase, void *(*do_thread)(void *), int t } } - uint level = atomic_fetch_and_add_u(&thread_levels, 1); - if (level == 0) { -#ifdef USE_APPLE_OMP_FIX - /* Workaround for Apple gcc 4.2.1 OMP vs background thread bug, - * we copy GOMP thread local storage pointer to setting it again - * inside the thread that we start. */ - thread_tls_data = pthread_getspecific(gomp_tls_key); -#endif - } + atomic_fetch_and_add_u(&thread_levels, 1); } int BLI_available_threads(ListBase *threadbase) @@ -194,13 +175,6 @@ int BLI_threadpool_available_thread_index(ListBase *threadbase) static void *tslot_thread_start(void *tslot_p) { ThreadSlot *tslot = (ThreadSlot *)tslot_p; - -#ifdef USE_APPLE_OMP_FIX - /* Workaround for Apple gcc 4.2.1 OMP vs background thread bug, - * set GOMP thread local storage pointer which was copied beforehand */ - pthread_setspecific(gomp_tls_key, thread_tls_data); -#endif - return tslot->do_thread(tslot->callerdata); } |