[Openmp-commits] [openmp] r366229 - [OpenMP] Move header inclusion out of 'extern "C"'

Jonas Hahnfeld via Openmp-commits openmp-commits at lists.llvm.org
Tue Jul 16 10:16:44 PDT 2019


Author: hahnfeld
Date: Tue Jul 16 10:16:43 2019
New Revision: 366229

URL: http://llvm.org/viewvc/llvm-project?rev=366229&view=rev
Log:
[OpenMP] Move header inclusion out of 'extern "C"'

This leads to problems when compiling C++ code with libc++ for Nvidia GPUs
because Clang now uses wrappers for math functions that might include
C++ templates not allowed in 'extern "C"'.

Differentiel Revision: https://reviews.llvm.org/D64625

Modified:
    openmp/trunk/runtime/src/include/omp.h.var

Modified: openmp/trunk/runtime/src/include/omp.h.var
URL: http://llvm.org/viewvc/llvm-project/openmp/trunk/runtime/src/include/omp.h.var?rev=366229&r1=366228&r2=366229&view=diff
==============================================================================
--- openmp/trunk/runtime/src/include/omp.h.var (original)
+++ openmp/trunk/runtime/src/include/omp.h.var Tue Jul 16 10:16:43 2019
@@ -15,6 +15,9 @@
 #ifndef __OMP_H
 #   define __OMP_H
 
+#   include <stdlib.h>
+#   include <stdint.h>
+
 #   define KMP_VERSION_MAJOR    @LIBOMP_VERSION_MAJOR@
 #   define KMP_VERSION_MINOR    @LIBOMP_VERSION_MINOR@
 #   define KMP_VERSION_BUILD    @LIBOMP_VERSION_BUILD@
@@ -134,8 +137,6 @@
     extern int  __KAI_KMPC_CONVENTION  omp_get_team_num (void);
     extern int  __KAI_KMPC_CONVENTION  omp_get_cancellation (void);
 
-#   include <stdlib.h>
-#   include <stdint.h>
     /* OpenMP 4.5 */
     extern int   __KAI_KMPC_CONVENTION  omp_get_initial_device (void);
     extern void* __KAI_KMPC_CONVENTION  omp_target_alloc(size_t, int);




More information about the Openmp-commits mailing list