code cleanup: replace PARALLEL define with _OPENMP
authorCampbell Barton <ideasman42@gmail.com>
Mon, 20 May 2013 16:15:16 +0000 (16:15 +0000)
committerCampbell Barton <ideasman42@gmail.com>
Mon, 20 May 2013 16:15:16 +0000 (16:15 +0000)
source/blender/blenkernel/CMakeLists.txt
source/blender/blenkernel/SConscript
source/blender/blenlib/CMakeLists.txt
source/blender/blenlib/SConscript
source/blender/blenlib/intern/threads.c
source/blender/editors/physics/CMakeLists.txt
source/blender/editors/physics/SConscript
source/blender/editors/render/CMakeLists.txt
source/blender/editors/render/SConscript
source/blender/modifiers/CMakeLists.txt

index 67f8f6b4f550e901e2c0c7c81c5a916abb044535..3864fe3b350d1d6c58e3f2eeef8e52bd6a9249de 100644 (file)
@@ -357,10 +357,6 @@ if(WITH_PYTHON)
        endif()
 endif()
 
-if(WITH_OPENMP)
-       add_definitions(-DPARALLEL=1)
-endif()
-
 if(WITH_MOD_FLUID)
        list(APPEND INC
                ../../../intern/elbeem/extern
index fb2ed4b6c070d0c75c22ada3f015280710f16e61..41684e5e535ee4213402c60c988823d3e92b7552 100644 (file)
@@ -114,10 +114,6 @@ if env['WITH_BF_QUICKTIME']:
 if env['WITH_BF_BULLET']:
     defs.append('WITH_BULLET')
 
-if env['OURPLATFORM'] == 'darwin':
-    if env['WITH_BF_OPENMP']:
-       defs.append('PARALLEL=1')
-
 if env['WITH_BF_FLUID']:
     defs.append('WITH_MOD_FLUID')
 
index a9955f1501667b80ccd72f353e4f1ead638bd3a2..0708b2fed4d6ba8fdaaf8018b3bbe4a9089e5873 100644 (file)
@@ -167,10 +167,6 @@ if(WITH_BINRELOC)
        add_definitions(-DWITH_BINRELOC)
 endif()
 
-if(WITH_OPENMP)
-       add_definitions(-DPARALLEL=1)
-endif()
-
 if(WIN32)
        list(APPEND INC
                ../../../intern/utfconv
index 41a9fe9e8b47f51c54698577dc5e52463d4ff544..0a2c3c0ebca4991f712ce93406228f2cd6252542 100644 (file)
@@ -50,8 +50,4 @@ if env['OURPLATFORM'] == 'linuxcross':
     if env['WITH_BF_OPENMP']:
         incs += ' ' + env['BF_OPENMP_INC']
 
-if env['OURPLATFORM'] == 'darwin':
-    if env['WITH_BF_OPENMP']:
-       env.Append(CFLAGS=['-DPARALLEL=1'])
-
 env.BlenderLib ( 'bf_blenlib', sources, Split(incs), Split(defs), libtype=['core','player'], priority = [370,230], compileflags =cflags )
index 84a8af71dd58305138770b58b4a2c3991d19dc03..e0ea3bbf685afbf5a44edeedb043fc3a5b51b7de 100644 (file)
 #  include <sys/time.h>
 #endif
 
-#if defined(__APPLE__) && (PARALLEL == 1) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
+#if defined(__APPLE__) && defined(_OPENMP) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
+#  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;
@@ -168,7 +172,7 @@ void BLI_init_threads(ListBase *threadbase, void *(*do_thread)(void *), int tot)
        if (thread_levels == 0) {
                MEM_set_lock_callback(BLI_lock_malloc_thread, BLI_unlock_malloc_thread);
 
-#if defined(__APPLE__) && (PARALLEL == 1) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
+#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 */
@@ -209,7 +213,7 @@ static void *tslot_thread_start(void *tslot_p)
 {
        ThreadSlot *tslot = (ThreadSlot *)tslot_p;
 
-#if defined(__APPLE__) && (PARALLEL == 1) && (__GNUC__ == 4) && (__GNUC_MINOR__ == 2)
+#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);
index 29d8aec4224c10323392420512b290566b43cdab..3701598f87ff0b038bd707142c7fa625ef25e2ad 100644 (file)
@@ -54,10 +54,6 @@ if(WITH_MOD_FLUID)
        add_definitions(-DWITH_MOD_FLUID)
 endif()
 
-if(WITH_OPENMP)
-       add_definitions(-DPARALLEL=1)
-endif()
-
 if(WITH_INTERNATIONAL)
        add_definitions(-DWITH_INTERNATIONAL)
 endif()
index 7916ea24bdeff7265942c5e817575d82e6855a24..2583c9f964a1adc7fe209f720d9c7b49f344bd66 100644 (file)
@@ -44,10 +44,6 @@ if env['OURPLATFORM'] == 'linux':
 if env['OURPLATFORM'] in ('win32-vc', 'win32-mingw', 'linuxcross', 'win64-vc', 'win64-mingw'):
     incs += ' ' + env['BF_PTHREADS_INC']
 
-if env['OURPLATFORM'] == 'darwin':
-    if env['WITH_BF_OPENMP']:
-       defs.append('PARALLEL=1')
-
 if env['WITH_BF_INTERNATIONAL']:
     defs.append('WITH_INTERNATIONAL')
 
index f628b2bb210615a90416111f15f5b14ca3ef9015..24015bd4ea37e6377915b84a36349452a78f830d 100644 (file)
@@ -60,10 +60,6 @@ if(WITH_CODEC_QUICKTIME)
        add_definitions(-DWITH_QUICKTIME)
 endif()
 
-if(WITH_OPENMP)
-       add_definitions(-DPARALLEL=1)
-endif()
-
 if(WITH_HEADLESS)
        add_definitions(-DWITH_HEADLESS)
 endif()
index 4c5da4dc78aba9703ace42909d073745ba17f7fe..db968590093e900e390048439c2e4c946d99aa5a 100644 (file)
@@ -55,10 +55,6 @@ if env['WITH_BF_QUICKTIME']:
 if env['USE_QTKIT']:
    env.Append(CFLAGS=['-DUSE_QTKIT'])
 
-if env['OURPLATFORM'] == 'darwin':
-    if env['WITH_BF_OPENMP']:
-       env.Append(CFLAGS=['-DPARALLEL=1'])
-
 if env['WITH_BF_INTERNATIONAL']:
     defs.append('WITH_INTERNATIONAL')
 
index 9f1361b490964fb7ddc0a73105c5f709ecd50205..72d9e320eb48b172a54fc925fa77dd681a977d9d 100644 (file)
@@ -146,8 +146,4 @@ if(WITH_INTERNATIONAL)
        add_definitions(-DWITH_INTERNATIONAL)
 endif()
 
-if(WITH_OPENMP)
-       add_definitions(-DPARALLEL=1)
-endif()
-
 blender_add_lib(bf_modifiers "${SRC}" "${INC}" "${INC_SYS}")