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 67f8f6b..3864fe3 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 fb2ed4b..41684e5 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 a9955f1..0708b2f 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 41a9fe9..0a2c3c0 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 84a8af7..e0ea3bb 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 29d8aec..3701598 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 7916ea2..2583c9f 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 f628b2b..24015bd 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 4c5da4d..db96859 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 9f1361b..72d9e32 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}")