Skip to content

Commit 9c3eb85

Browse files
committed
[OMPD] Runtime Entry Point functions for OMPD in libomp.so is mangled.
Encapsulating required OMPD and OMPT data structures and signatures within extern "C" as per the supplementary soure file for omp-tools.h provided by the OpenMP spec https://github.com/OpenMP/sources/blob/main/include/omp-tools.h, thus ensuring that the OMPD runtime entry point functions have C linkage and are not mangled.
1 parent f0c3870 commit 9c3eb85

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,10 @@ typedef enum kmp_mutex_impl_t {
211211
* definitions generated from spec
212212
*****************************************************************************/
213213

214+
#if defined(__cplusplus)
215+
extern "C" {
216+
#endif
217+
214218
typedef enum ompt_callbacks_t {
215219
ompt_callback_thread_begin = 1,
216220
ompt_callback_thread_end = 2,
@@ -1414,4 +1418,8 @@ typedef ompt_record_ompt_t *(*ompt_get_record_ompt_t) (
14141418

14151419
#define ompd_segment_none 0
14161420

1421+
#if defined(__cplusplus)
1422+
} // extern "C"
1423+
#endif
1424+
14171425
#endif /* __OMPT__ */

0 commit comments

Comments
 (0)