aboutsummaryrefslogtreecommitdiff
path: root/openmp/runtime
diff options
context:
space:
mode:
authorYuki Okushi <jtitor@2k36.org>2022-06-02 20:34:04 +0900
committerYuki Okushi <jtitor@2k36.org>2022-06-09 22:12:42 +0900
commit074f12e46795c91ba2c0effe7b93c39af5b0a3ac (patch)
tree73fd6fbb22259e48f7c8b63711aa1883ba964051 /openmp/runtime
parent8feb92add88adbb53729dd10f12667bb326e021e (diff)
downloadllvm-074f12e46795c91ba2c0effe7b93c39af5b0a3ac.zip
llvm-074f12e46795c91ba2c0effe7b93c39af5b0a3ac.tar.gz
llvm-074f12e46795c91ba2c0effe7b93c39af5b0a3ac.tar.bz2
[OpenMP] Fix the build on Windows
The code expanded from kmp_barrier.h uses some `KMP_INTERNAL_*`s, so the definitions have to be placed before it. Fixes #55815 Differential Revision: https://reviews.llvm.org/D126873
Diffstat (limited to 'openmp/runtime')
-rw-r--r--openmp/runtime/src/kmp.h11
1 files changed, 6 insertions, 5 deletions
diff --git a/openmp/runtime/src/kmp.h b/openmp/runtime/src/kmp.h
index 41d3b64..57798e2 100644
--- a/openmp/runtime/src/kmp.h
+++ b/openmp/runtime/src/kmp.h
@@ -106,6 +106,12 @@ class kmp_stats_list;
#include <xmmintrin.h>
#endif
+// The below has to be defined before including "kmp_barrier.h".
+#define KMP_INTERNAL_MALLOC(sz) malloc(sz)
+#define KMP_INTERNAL_FREE(p) free(p)
+#define KMP_INTERNAL_REALLOC(p, sz) realloc((p), (sz))
+#define KMP_INTERNAL_CALLOC(n, sz) calloc((n), (sz))
+
#include "kmp_debug.h"
#include "kmp_lock.h"
#include "kmp_version.h"
@@ -3462,11 +3468,6 @@ extern void ___kmp_thread_free(kmp_info_t *th, void *ptr KMP_SRC_LOC_DECL);
#define __kmp_thread_free(th, ptr) \
___kmp_thread_free((th), (ptr)KMP_SRC_LOC_CURR)
-#define KMP_INTERNAL_MALLOC(sz) malloc(sz)
-#define KMP_INTERNAL_FREE(p) free(p)
-#define KMP_INTERNAL_REALLOC(p, sz) realloc((p), (sz))
-#define KMP_INTERNAL_CALLOC(n, sz) calloc((n), (sz))
-
extern void __kmp_push_num_threads(ident_t *loc, int gtid, int num_threads);
extern void __kmp_push_proc_bind(ident_t *loc, int gtid,