summaryrefslogtreecommitdiff
path: root/openmp
diff options
context:
space:
mode:
authorAndrey Churbanov <Andrey.Churbanov@intel.com>2018-12-10 13:45:00 +0000
committerAndrey Churbanov <Andrey.Churbanov@intel.com>2018-12-10 13:45:00 +0000
commite1b201e55269644c8374e2a4b5553410d9e1b500 (patch)
tree57651e70c2b41e90f78838273cc044b1124006a1 /openmp
parentad48798f7f3aef3d83fd49dcafd300e7126d88d2 (diff)
Support clang compiling under windows-gnu and windows-msvc
Patch by Peiyuan Song <squallatf@gmail.com> Differential Revision: https://reviews.llvm.org/D53422
Diffstat (limited to 'openmp')
-rw-r--r--openmp/runtime/cmake/LibompHandleFlags.cmake1
-rw-r--r--openmp/runtime/cmake/config-ix.cmake17
-rw-r--r--openmp/runtime/src/kmp.h6
-rw-r--r--openmp/runtime/src/kmp_affinity.h10
-rw-r--r--openmp/runtime/src/kmp_config.h.cmake2
-rw-r--r--openmp/runtime/src/kmp_dispatch.cpp12
-rw-r--r--openmp/runtime/src/kmp_io.cpp4
-rw-r--r--openmp/runtime/src/kmp_lock.cpp3
-rw-r--r--openmp/runtime/src/kmp_os.h11
-rw-r--r--openmp/runtime/src/kmp_platform.h2
-rw-r--r--openmp/runtime/src/kmp_safe_c_api.h2
-rw-r--r--openmp/runtime/src/kmp_settings.cpp2
-rw-r--r--openmp/runtime/src/kmp_utility.cpp4
-rw-r--r--openmp/runtime/src/kmp_wrapper_getpid.h2
-rw-r--r--openmp/runtime/src/kmp_wrapper_malloc.h2
-rw-r--r--openmp/runtime/src/libomp.rc.var2
-rw-r--r--openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.c19
-rw-r--r--openmp/runtime/src/z_Windows_NT_util.cpp1
18 files changed, 69 insertions, 33 deletions
diff --git a/openmp/runtime/cmake/LibompHandleFlags.cmake b/openmp/runtime/cmake/LibompHandleFlags.cmake
index cf90ae12ee9..0b829a51aee 100644
--- a/openmp/runtime/cmake/LibompHandleFlags.cmake
+++ b/openmp/runtime/cmake/LibompHandleFlags.cmake
@@ -50,6 +50,7 @@ function(libomp_get_c_and_cxxflags_common flags)
libomp_append(flags_local /GS LIBOMP_HAVE_GS_FLAG)
libomp_append(flags_local /EHsc LIBOMP_HAVE_EHSC_FLAG)
libomp_append(flags_local /Oy- LIBOMP_HAVE_OY__FLAG)
+ libomp_append(flags_local -mrtm LIBOMP_HAVE_MRTM_FLAG)
# Intel(R) C Compiler flags
libomp_append(flags_local /Qsafeseh LIBOMP_HAVE_QSAFESEH_FLAG)
libomp_append(flags_local -Qoption,cpp,--extended_float_types LIBOMP_HAVE_EXTENDED_FLOAT_TYPES_FLAG)
diff --git a/openmp/runtime/cmake/config-ix.cmake b/openmp/runtime/cmake/config-ix.cmake
index 5415e57c258..019c83c4483 100644
--- a/openmp/runtime/cmake/config-ix.cmake
+++ b/openmp/runtime/cmake/config-ix.cmake
@@ -73,13 +73,16 @@ check_c_compiler_flag(-ftls-model=initial-exec LIBOMP_HAVE_FTLS_MODEL_FLAG)
libomp_check_architecture_flag(-mmic LIBOMP_HAVE_MMIC_FLAG)
libomp_check_architecture_flag(-m32 LIBOMP_HAVE_M32_FLAG)
if(WIN32)
- # Check Windows MSVC style flags.
- check_c_compiler_flag(/TP LIBOMP_HAVE_TP_FLAG)
- check_cxx_compiler_flag(/EHsc LIBOMP_HAVE_EHSC_FLAG)
- check_cxx_compiler_flag(/GS LIBOMP_HAVE_GS_FLAG)
- check_cxx_compiler_flag(/Oy- LIBOMP_HAVE_Oy__FLAG)
- check_cxx_compiler_flag(/arch:SSE2 LIBOMP_HAVE_ARCH_SSE2_FLAG)
- check_cxx_compiler_flag(/Qsafeseh LIBOMP_HAVE_QSAFESEH_FLAG)
+ if(MSVC)
+ # Check Windows MSVC style flags.
+ check_c_compiler_flag(/TP LIBOMP_HAVE_TP_FLAG)
+ check_cxx_compiler_flag(/EHsc LIBOMP_HAVE_EHSC_FLAG)
+ check_cxx_compiler_flag(/GS LIBOMP_HAVE_GS_FLAG)
+ check_cxx_compiler_flag(/Oy- LIBOMP_HAVE_Oy__FLAG)
+ check_cxx_compiler_flag(/arch:SSE2 LIBOMP_HAVE_ARCH_SSE2_FLAG)
+ check_cxx_compiler_flag(/Qsafeseh LIBOMP_HAVE_QSAFESEH_FLAG)
+ endif()
+ check_c_compiler_flag(-mrtm LIBOMP_HAVE_MRTM_FLAG)
# It is difficult to create a dummy masm assembly file
# and then check the MASM assembler to see if these flags exist and work,
# so we assume they do for Windows.
diff --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h
index 3a99cded773..c09f4b2d7ec 100644
--- a/openmp/runtime/src/kmp.h
+++ b/openmp/runtime/src/kmp.h
@@ -544,11 +544,15 @@ typedef int PACKED_REDUCTION_METHOD_T;
#if KMP_OS_WINDOWS
#define USE_CBLKDATA
+#if KMP_MSVC_COMPAT
#pragma warning(push)
#pragma warning(disable : 271 310)
+#endif
#include <windows.h>
+#if KMP_MSVC_COMPAT
#pragma warning(pop)
#endif
+#endif
#if KMP_OS_UNIX
#include <dlfcn.h>
@@ -560,7 +564,7 @@ typedef int PACKED_REDUCTION_METHOD_T;
// GROUP_AFFINITY is already defined for _MSC_VER>=1600 (VS2010 and later).
#if KMP_OS_WINDOWS
-#if _MSC_VER < 1600
+#if _MSC_VER < 1600 && KMP_MSVC_COMPAT
typedef struct GROUP_AFFINITY {
KAFFINITY Mask;
WORD Group;
diff --git a/openmp/runtime/src/kmp_affinity.h b/openmp/runtime/src/kmp_affinity.h
index 6ff920e5c25..34147fd395b 100644
--- a/openmp/runtime/src/kmp_affinity.h
+++ b/openmp/runtime/src/kmp_affinity.h
@@ -375,26 +375,26 @@ class KMPNativeAffinity : public KMPAffinity {
mask[i / BITS_PER_MASK_T] &= ~((mask_t)1 << (i % BITS_PER_MASK_T));
}
void zero() override {
- for (size_t i = 0; i < __kmp_num_proc_groups; ++i)
+ for (int i = 0; i < __kmp_num_proc_groups; ++i)
mask[i] = 0;
}
void copy(const KMPAffinity::Mask *src) override {
const Mask *convert = static_cast<const Mask *>(src);
- for (size_t i = 0; i < __kmp_num_proc_groups; ++i)
+ for (int i = 0; i < __kmp_num_proc_groups; ++i)
mask[i] = convert->mask[i];
}
void bitwise_and(const KMPAffinity::Mask *rhs) override {
const Mask *convert = static_cast<const Mask *>(rhs);
- for (size_t i = 0; i < __kmp_num_proc_groups; ++i)
+ for (int i = 0; i < __kmp_num_proc_groups; ++i)
mask[i] &= convert->mask[i];
}
void bitwise_or(const KMPAffinity::Mask *rhs) override {
const Mask *convert = static_cast<const Mask *>(rhs);
- for (size_t i = 0; i < __kmp_num_proc_groups; ++i)
+ for (int i = 0; i < __kmp_num_proc_groups; ++i)
mask[i] |= convert->mask[i];
}
void bitwise_not() override {
- for (size_t i = 0; i < __kmp_num_proc_groups; ++i)
+ for (int i = 0; i < __kmp_num_proc_groups; ++i)
mask[i] = ~(mask[i]);
}
int begin() const override {
diff --git a/openmp/runtime/src/kmp_config.h.cmake b/openmp/runtime/src/kmp_config.h.cmake
index 6b778ea97f4..c9ebbc0bd77 100644
--- a/openmp/runtime/src/kmp_config.h.cmake
+++ b/openmp/runtime/src/kmp_config.h.cmake
@@ -74,6 +74,8 @@
#if LIBOMP_TSAN_SUPPORT
#define TSAN_SUPPORT
#endif
+#cmakedefine01 MSVC
+#define KMP_MSVC_COMPAT MSVC
// Configured cache line based on architecture
#if KMP_ARCH_PPC64
diff --git a/openmp/runtime/src/kmp_dispatch.cpp b/openmp/runtime/src/kmp_dispatch.cpp
index b4192dfb5bf..1090e9de1d0 100644
--- a/openmp/runtime/src/kmp_dispatch.cpp
+++ b/openmp/runtime/src/kmp_dispatch.cpp
@@ -24,7 +24,7 @@
#include "kmp_itt.h"
#include "kmp_stats.h"
#include "kmp_str.h"
-#if KMP_OS_WINDOWS && KMP_ARCH_X86
+#if KMP_USE_X87CONTROL
#include <float.h>
#endif
#include "kmp_lock.h"
@@ -478,7 +478,7 @@ void __kmp_dispatch_init_algorithm(ident_t *loc, int gtid,
/* commonly used term: (2 nproc - 1)/(2 nproc) */
DBL x;
-#if KMP_OS_WINDOWS && KMP_ARCH_X86
+#if KMP_USE_X87CONTROL
/* Linux* OS already has 64-bit computation by default for long double,
and on Windows* OS on Intel(R) 64, /Qlong_double doesn't work. On
Windows* OS on IA-32 architecture, we need to set precision to 64-bit
@@ -573,7 +573,7 @@ void __kmp_dispatch_init_algorithm(ident_t *loc, int gtid,
pr->u.p.count = tc - __kmp_dispatch_guided_remaining(
tc, GUIDED_ANALYTICAL_WORKAROUND, cross) -
cross * chunk;
-#if KMP_OS_WINDOWS && KMP_ARCH_X86
+#if KMP_USE_X87CONTROL
// restore FPCW
_control87(oldFpcw, _MCW_PC);
#endif
@@ -1625,7 +1625,7 @@ int __kmp_dispatch_next_algorithm(int gtid,
case kmp_sch_guided_analytical_chunked: {
T chunkspec = pr->u.p.parm1;
UT chunkIdx;
-#if KMP_OS_WINDOWS && KMP_ARCH_X86
+#if KMP_USE_X87CONTROL
/* for storing original FPCW value for Windows* OS on
IA-32 architecture 8-byte version */
unsigned int oldFpcw;
@@ -1662,7 +1662,7 @@ int __kmp_dispatch_next_algorithm(int gtid,
Windows* OS.
This check works around the possible effect that init != 0 for chunkIdx == 0.
*/
-#if KMP_OS_WINDOWS && KMP_ARCH_X86
+#if KMP_USE_X87CONTROL
/* If we haven't already done so, save original
FPCW and set precision to 64-bit, as Windows* OS
on IA-32 architecture defaults to 53-bit */
@@ -1690,7 +1690,7 @@ int __kmp_dispatch_next_algorithm(int gtid,
} // if
} // if
} // while (1)
-#if KMP_OS_WINDOWS && KMP_ARCH_X86
+#if KMP_USE_X87CONTROL
/* restore FPCW if necessary
AC: check fpcwSet flag first because oldFpcw can be uninitialized here
*/
diff --git a/openmp/runtime/src/kmp_io.cpp b/openmp/runtime/src/kmp_io.cpp
index 4f58ea0e580..73508330b77 100644
--- a/openmp/runtime/src/kmp_io.cpp
+++ b/openmp/runtime/src/kmp_io.cpp
@@ -27,11 +27,15 @@
#include "kmp_str.h"
#if KMP_OS_WINDOWS
+#if KMP_MSVC_COMPAT
#pragma warning(push)
#pragma warning(disable : 271 310)
+#endif
#include <windows.h>
+#if KMP_MSVC_COMPAT
#pragma warning(pop)
#endif
+#endif
/* ------------------------------------------------------------------------ */
diff --git a/openmp/runtime/src/kmp_lock.cpp b/openmp/runtime/src/kmp_lock.cpp
index 16834c65861..cf606e7e9f1 100644
--- a/openmp/runtime/src/kmp_lock.cpp
+++ b/openmp/runtime/src/kmp_lock.cpp
@@ -1716,7 +1716,8 @@ static void __kmp_set_queuing_lock_flags(kmp_queuing_lock_t *lck,
/* RTM Adaptive locks */
-#if KMP_COMPILER_ICC && __INTEL_COMPILER >= 1300
+#if (KMP_COMPILER_ICC && __INTEL_COMPILER >= 1300) || \
+ (KMP_COMPILER_MSVC && _MSC_VER >= 1700) || KMP_COMPILER_CLANG
#include <immintrin.h>
#define SOFT_ABORT_MASK (_XABORT_RETRY | _XABORT_CONFLICT | _XABORT_EXPLICIT)
diff --git a/openmp/runtime/src/kmp_os.h b/openmp/runtime/src/kmp_os.h
index 93743ad313a..467fd965512 100644
--- a/openmp/runtime/src/kmp_os.h
+++ b/openmp/runtime/src/kmp_os.h
@@ -100,6 +100,7 @@ typedef long double _Quad;
#endif
#endif /* KMP_ARCH_X86 || KMP_ARCH_X86_64 */
+#define KMP_USE_X87CONTROL 0
#if KMP_OS_WINDOWS
typedef char kmp_int8;
typedef unsigned char kmp_uint8;
@@ -122,6 +123,10 @@ typedef struct kmp_struct64 kmp_int64;
typedef struct kmp_struct64 kmp_uint64;
/* Not sure what to use for KMP_[U]INT64_SPEC here */
#endif
+#if KMP_ARCH_X86 && KMP_MSVC_COMPAT
+#undef KMP_USE_X87CONTROL
+#define KMP_USE_X87CONTROL 1
+#endif
#if KMP_ARCH_X86_64
#define KMP_INTPTR 1
typedef __int64 kmp_intptr_t;
@@ -246,7 +251,7 @@ template <> struct traits_t<unsigned long long> {
#define KMP_EXPORT extern /* export declaration in guide libraries */
-#if __GNUC__ >= 4
+#if __GNUC__ >= 4 && !defined(__MINGW32__)
#define __forceinline __inline
#endif
@@ -296,7 +301,7 @@ extern "C" {
#define KMP_NORETURN __attribute__((noreturn))
#endif
-#if KMP_OS_WINDOWS
+#if KMP_OS_WINDOWS && KMP_MSVC_COMPAT
#define KMP_ALIGN(bytes) __declspec(align(bytes))
#define KMP_THREAD_LOCAL __declspec(thread)
#define KMP_ALIAS /* Nothing */
@@ -356,10 +361,12 @@ enum kmp_mem_fence_type {
#if KMP_ASM_INTRINS && KMP_OS_WINDOWS
+#if KMP_MSVC_COMPAT && !KMP_COMPILER_CLANG
#pragma intrinsic(InterlockedExchangeAdd)
#pragma intrinsic(InterlockedCompareExchange)
#pragma intrinsic(InterlockedExchange)
#pragma intrinsic(InterlockedExchange64)
+#endif
// Using InterlockedIncrement / InterlockedDecrement causes a library loading
// ordering problem, so we use InterlockedExchangeAdd instead.
diff --git a/openmp/runtime/src/kmp_platform.h b/openmp/runtime/src/kmp_platform.h
index 8d46967477e..bb23de03d84 100644
--- a/openmp/runtime/src/kmp_platform.h
+++ b/openmp/runtime/src/kmp_platform.h
@@ -101,7 +101,7 @@
#define KMP_ARCH_MIPS64 0
#if KMP_OS_WINDOWS
-#if defined _M_AMD64
+#if defined(_M_AMD64) || defined(__x86_64)
#undef KMP_ARCH_X86_64
#define KMP_ARCH_X86_64 1
#else
diff --git a/openmp/runtime/src/kmp_safe_c_api.h b/openmp/runtime/src/kmp_safe_c_api.h
index 9d0da0b6073..7dfd2783cb0 100644
--- a/openmp/runtime/src/kmp_safe_c_api.h
+++ b/openmp/runtime/src/kmp_safe_c_api.h
@@ -15,7 +15,7 @@
// Not every unsafe call listed here is handled now, but keeping everything
// in one place should be handy for future maintenance.
-#if KMP_OS_WINDOWS
+#if KMP_OS_WINDOWS && KMP_MSVC_COMPAT
#define RSIZE_MAX_STR (4UL << 10) // 4KB
diff --git a/openmp/runtime/src/kmp_settings.cpp b/openmp/runtime/src/kmp_settings.cpp
index 7cb5d3655fa..37690a2c9e3 100644
--- a/openmp/runtime/src/kmp_settings.cpp
+++ b/openmp/runtime/src/kmp_settings.cpp
@@ -5513,7 +5513,7 @@ void __kmp_env_initialize(char const *string) {
// then determine if it is equal to that single group.
if (within_one_group) {
DWORD num_bits_in_group = __kmp_GetActiveProcessorCount(group);
- int num_bits_in_mask = 0;
+ DWORD num_bits_in_mask = 0;
for (int bit = init_mask->begin(); bit != init_mask->end();
bit = init_mask->next(bit))
num_bits_in_mask++;
diff --git a/openmp/runtime/src/kmp_utility.cpp b/openmp/runtime/src/kmp_utility.cpp
index 06090e624c7..dc4c714f8d8 100644
--- a/openmp/runtime/src/kmp_utility.cpp
+++ b/openmp/runtime/src/kmp_utility.cpp
@@ -375,7 +375,11 @@ void __kmp_expand_file_name(char *result, size_t rlen, char *pattern) {
case 'I':
case 'i': {
pid_t id = getpid();
+#if KMP_ARCH_X86_64 && defined(__MINGW32__)
+ snp_result = KMP_SNPRINTF(pos, end - pos + 1, "%0*lld", width, id);
+#else
snp_result = KMP_SNPRINTF(pos, end - pos + 1, "%0*d", width, id);
+#endif
if (snp_result >= 0 && snp_result <= end - pos) {
while (*pos)
++pos;
diff --git a/openmp/runtime/src/kmp_wrapper_getpid.h b/openmp/runtime/src/kmp_wrapper_getpid.h
index 5b4081a82a0..a9ddbe87d86 100644
--- a/openmp/runtime/src/kmp_wrapper_getpid.h
+++ b/openmp/runtime/src/kmp_wrapper_getpid.h
@@ -39,7 +39,9 @@
// "process.h".
#include <process.h>
// Let us simulate Unix.
+#if KMP_MSVC_COMPAT
typedef int pid_t;
+#endif
#define getpid _getpid
#define __kmp_gettid() GetCurrentThreadId()
diff --git a/openmp/runtime/src/kmp_wrapper_malloc.h b/openmp/runtime/src/kmp_wrapper_malloc.h
index b690c515651..c8d2c70c809 100644
--- a/openmp/runtime/src/kmp_wrapper_malloc.h
+++ b/openmp/runtime/src/kmp_wrapper_malloc.h
@@ -93,7 +93,9 @@
// Include alloca() declaration.
#if KMP_OS_WINDOWS
#include <malloc.h> // Windows* OS: _alloca() declared in "malloc.h".
+#if KMP_MSVC_COMPAT
#define alloca _alloca // Allow to use alloca() with no underscore.
+#endif
#elif KMP_OS_DRAGONFLY || KMP_OS_FREEBSD || KMP_OS_NETBSD || KMP_OS_OPENBSD
// Declared in "stdlib.h".
#elif KMP_OS_UNIX
diff --git a/openmp/runtime/src/libomp.rc.var b/openmp/runtime/src/libomp.rc.var
index cf6a9c9efa2..32449e2b8d6 100644
--- a/openmp/runtime/src/libomp.rc.var
+++ b/openmp/runtime/src/libomp.rc.var
@@ -11,7 +11,7 @@
////===----------------------------------------------------------------------===//
//
-#include "winres.h"
+#include "winresrc.h"
#include "kmp_config.h"
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US // English (U.S.) resources
diff --git a/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.c b/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.c
index 75ef9666fba..63e1b0c6f67 100644
--- a/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.c
+++ b/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.c
@@ -12,7 +12,11 @@
#include "ittnotify_config.h"
#if ITT_PLATFORM==ITT_PLATFORM_WIN
+#if defined(__MINGW32__)
+#include <limits.h>
+#else
#define PATH_MAX 512
+#endif
#else /* ITT_PLATFORM!=ITT_PLATFORM_WIN */
#include <limits.h>
#include <dlfcn.h>
@@ -28,7 +32,9 @@
#include "ittnotify.h"
#include "legacy/ittnotify.h"
+#if KMP_MSVC_COMPAT
#include "disable_warnings.h"
+#endif
static const char api_version[] = API_VERSION "\0\n@(#) $Revision: 481659 $\n";
@@ -194,7 +200,7 @@ static __itt_group_alias group_alias[] = {
#pragma pack(pop)
-#if ITT_PLATFORM==ITT_PLATFORM_WIN
+#if ITT_PLATFORM==ITT_PLATFORM_WIN && KMP_MSVC_COMPAT
#pragma warning(push)
#pragma warning(disable: 4054) /* warning C4054: 'type cast' : from function pointer 'XXX' to data pointer 'void *' */
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
@@ -217,7 +223,7 @@ static __itt_api_info api_list[] = {
{NULL, NULL, NULL, NULL, __itt_group_none}
};
-#if ITT_PLATFORM==ITT_PLATFORM_WIN
+#if ITT_PLATFORM==ITT_PLATFORM_WIN && KMP_MSVC_COMPAT
#pragma warning(pop)
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
@@ -252,7 +258,7 @@ typedef void (__itt_api_fini_t)(__itt_global*);
ITT_EXTERN_C void _N_(error_handler)(__itt_error_code, va_list args);
#endif /* ITT_NOTIFY_EXT_REPORT */
-#if ITT_PLATFORM==ITT_PLATFORM_WIN
+#if ITT_PLATFORM==ITT_PLATFORM_WIN && KMP_MSVC_COMPAT
#pragma warning(push)
#pragma warning(disable: 4055) /* warning C4055: 'type cast' : from data pointer 'void *' to function pointer 'XXX' */
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
@@ -278,7 +284,7 @@ static void __itt_report_error(unsigned code_arg, ...)
va_end(args);
}
-#if ITT_PLATFORM==ITT_PLATFORM_WIN
+#if ITT_PLATFORM==ITT_PLATFORM_WIN && KMP_MSVC_COMPAT
#pragma warning(pop)
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
@@ -1013,7 +1019,7 @@ static void __itt_nullify_all_pointers(void)
*_N_(_ittapi_global).api_list_ptr[i].func_ptr = _N_(_ittapi_global).api_list_ptr[i].null_func;
}
-#if ITT_PLATFORM==ITT_PLATFORM_WIN
+#if ITT_PLATFORM==ITT_PLATFORM_WIN && KMP_MSVC_COMPAT
#pragma warning(push)
#pragma warning(disable: 4054) /* warning C4054: 'type cast' : from function pointer 'XXX' to data pointer 'void *' */
#pragma warning(disable: 4055) /* warning C4055: 'type cast' : from data pointer 'void *' to function pointer 'XXX' */
@@ -1191,7 +1197,6 @@ ITT_EXTERN_C __itt_error_handler_t* _N_(set_error_handler)(__itt_error_handler_t
return prev;
}
-#if ITT_PLATFORM==ITT_PLATFORM_WIN
+#if ITT_PLATFORM==ITT_PLATFORM_WIN && KMP_MSVC_COMPAT
#pragma warning(pop)
#endif /* ITT_PLATFORM==ITT_PLATFORM_WIN */
-
diff --git a/openmp/runtime/src/z_Windows_NT_util.cpp b/openmp/runtime/src/z_Windows_NT_util.cpp
index e8ed6603b4b..f3d667f19f5 100644
--- a/openmp/runtime/src/z_Windows_NT_util.cpp
+++ b/openmp/runtime/src/z_Windows_NT_util.cpp
@@ -887,6 +887,7 @@ kmp_uint64 __kmp_now_nsec() {
return 1e9 * __kmp_win32_tick * now.QuadPart;
}
+extern "C"
void *__stdcall __kmp_launch_worker(void *arg) {
volatile void *stack_data;
void *exit_val;