diff options
| -rw-r--r-- | openmp/runtime/src/kmp_atomic.h | 7 | ||||
| -rw-r--r-- | openmp/runtime/src/kmp_csupport.c | 4 |
2 files changed, 10 insertions, 1 deletions
diff --git a/openmp/runtime/src/kmp_atomic.h b/openmp/runtime/src/kmp_atomic.h index 33feae2189f..59b7b009b56 100644 --- a/openmp/runtime/src/kmp_atomic.h +++ b/openmp/runtime/src/kmp_atomic.h @@ -35,6 +35,13 @@ #if defined( __cplusplus ) && ( KMP_OS_WINDOWS ) // create shortcuts for c99 complex types + // Visual Studio cannot have function parameters that have the + // align __declspec attribute, so we must remove it. (Compiler Error C2719) + #if KMP_COMPILER_MSVC + # undef KMP_DO_ALIGN + # define KMP_DO_ALIGN(alignment) /* Nothing */ + #endif + #if (_MSC_VER < 1600) && defined(_DEBUG) // Workaround for the problem of _DebugHeapTag unresolved external. // This problem prevented to use our static debug library for C tests diff --git a/openmp/runtime/src/kmp_csupport.c b/openmp/runtime/src/kmp_csupport.c index 42d5e41c84f..456cb6bbee8 100644 --- a/openmp/runtime/src/kmp_csupport.c +++ b/openmp/runtime/src/kmp_csupport.c @@ -654,8 +654,10 @@ __kmpc_flush(ident_t *loc) if ( ! __kmp_cpuinfo.sse2 ) { // CPU cannot execute SSE2 instructions. } else { - #if KMP_COMPILER_ICC || KMP_COMPILER_MSVC + #if KMP_COMPILER_ICC _mm_mfence(); + #elif KMP_COMPILER_MSVC + MemoryBarrier(); #else __sync_synchronize(); #endif // KMP_COMPILER_ICC |

