[Openmp-commits] [openmp] edfc21a - [OMPD] Runtime Entry Point functions for OMPD in libomp.so need C linkage as per standard. (#79246)

via Openmp-commits openmp-commits at lists.llvm.org
Tue Feb 6 01:12:52 PST 2024


Author: vigbalu
Date: 2024-02-06T10:12:47+01:00
New Revision: edfc21a5759e9f5f5025885da9b0b879204aff22

URL: https://github.com/llvm/llvm-project/commit/edfc21a5759e9f5f5025885da9b0b879204aff22
DIFF: https://github.com/llvm/llvm-project/commit/edfc21a5759e9f5f5025885da9b0b879204aff22.diff

LOG: [OMPD] Runtime Entry Point functions for OMPD in libomp.so need C linkage as per standard. (#79246)

Adding extern "C" to all the entry point functions to make sure that
these functions are not mangled.

Added: 
    

Modified: 
    openmp/runtime/src/include/omp-tools.h.var

Removed: 
    


################################################################################
diff  --git a/openmp/runtime/src/include/omp-tools.h.var b/openmp/runtime/src/include/omp-tools.h.var
index a3ec0309db18c..1d1a0f7771e95 100644
--- a/openmp/runtime/src/include/omp-tools.h.var
+++ b/openmp/runtime/src/include/omp-tools.h.var
@@ -211,6 +211,10 @@ typedef enum kmp_mutex_impl_t {
  * definitions generated from spec
  *****************************************************************************/
 
+#if defined(__cplusplus)
+extern "C" {
+#endif
+
 typedef enum ompt_callbacks_t {
   ompt_callback_thread_begin             = 1,
   ompt_callback_thread_end               = 2,
@@ -1414,4 +1418,8 @@ typedef ompt_record_ompt_t *(*ompt_get_record_ompt_t) (
 
 #define ompd_segment_none 0
 
+#if defined(__cplusplus)
+} // extern "C"
+#endif
+
 #endif /* __OMPT__ */


        


More information about the Openmp-commits mailing list