From d48f726e47fc5255a5028eb2b114bf25e02ef79c Mon Sep 17 00:00:00 2001 From: Arnaud Giersch Date: Mon, 18 Jun 2018 17:16:46 +0200 Subject: [PATCH] Missing extern "C" in smpi_helpers.h. --- include/smpi/smpi_helpers.h | 7 +++++++ src/smpi/smpicxx.in | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/include/smpi/smpi_helpers.h b/include/smpi/smpi_helpers.h index 58963b91dc..3a87fdefeb 100644 --- a/include/smpi/smpi_helpers.h +++ b/include/smpi/smpi_helpers.h @@ -11,6 +11,10 @@ #include #endif +#ifdef __cplusplus +extern "C" { +#endif + int smpi_usleep(useconds_t usecs); #if _POSIX_TIMERS > 0 int smpi_nanosleep(const struct timespec* tp, struct timespec* t); @@ -36,4 +40,7 @@ int smpi_getopt (int argc, char *const *argv, const char *options); #define getopt_long(x,y,z,a,b) smpi_getopt_long(x,y,z,a,b) #define getopt_long_only(x,y,z,a,b) smpi_getopt_long_only(x,y,z,a,b) +#ifdef __cplusplus +} // extern "C" +#endif #endif diff --git a/src/smpi/smpicxx.in b/src/smpi/smpicxx.in index 0af62a7c57..1e6b88d093 100755 --- a/src/smpi/smpicxx.in +++ b/src/smpi/smpicxx.in @@ -19,7 +19,7 @@ CMAKE_LINKARGS="-L@libdir@" list_set CXXFLAGS "-std=gnu++11" list_set LINKARGS "-std=gnu++11" if [ "@WIN32@" != "1" ]; then - # list_add CXXFLAGS "-Dmain=smpi_simulated_main_" + # list_add CXXFLAGS "-include" "@includedir@/smpi/smpi_helpers.h" list_add CXXFLAGS "-fpic" if [ "x${SMPI_PRETEND_CC}" = "x" ]; then list_add LINKARGS "-shared" -- 2.20.1