summaryrefslogtreecommitdiffstats
path: root/openmp/runtime/src/thirdparty/ittnotify
diff options
context:
space:
mode:
authorJonathan Peyton <jonathan.l.peyton@intel.com>2015-06-05 20:24:13 +0000
committerJonathan Peyton <jonathan.l.peyton@intel.com>2015-06-05 20:24:13 +0000
commit4959fda719dad29f5ab8a3e7e4da59a794609fe5 (patch)
treec6a78758ee861a19193c5c648d2b94890bb00b67 /openmp/runtime/src/thirdparty/ittnotify
parent77f20fc8d3563b871bc460f55dd204f34ff6762e (diff)
downloadbcm5719-llvm-4959fda719dad29f5ab8a3e7e4da59a794609fe5.tar.gz
bcm5719-llvm-4959fda719dad29f5ab8a3e7e4da59a794609fe5.zip
Fix extern warnings produced by ittnotify_static.c
when compiling with gcc or clang numerous warnings concerning the usage of extern "C" linkage. All the __kmp_itt_sync* variables are declared like: extern "C" type __kmp_itt_sync... = definition; through various macros. This note from cppreference.com explains why this is a problem. // From http://en.cppreference.com/w/cpp/language/language_linkage extern "C" int x; // a declaration and not a definition // The above line is equivalent to extern "C" { extern int x; } extern "C" { int x; } // a declaration and definition Since the __kmp_itt_* variables are being declared and defined, these variables should use the bracketed version instead. llvm-svn: 239184
Diffstat (limited to 'openmp/runtime/src/thirdparty/ittnotify')
-rw-r--r--openmp/runtime/src/thirdparty/ittnotify/ittnotify_config.h4
-rw-r--r--openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/openmp/runtime/src/thirdparty/ittnotify/ittnotify_config.h b/openmp/runtime/src/thirdparty/ittnotify/ittnotify_config.h
index 1323254f18b..c1bfbcc4432 100644
--- a/openmp/runtime/src/thirdparty/ittnotify/ittnotify_config.h
+++ b/openmp/runtime/src/thirdparty/ittnotify/ittnotify_config.h
@@ -160,8 +160,12 @@
#ifdef __cplusplus
# define ITT_EXTERN_C extern "C"
+# define ITT_EXTERN_C_BEGIN extern "C" {
+# define ITT_EXTERN_C_END }
#else
# define ITT_EXTERN_C /* nothing */
+# define ITT_EXTERN_C_BEGIN /* nothing */
+# define ITT_EXTERN_C_END /* nothing */
#endif /* __cplusplus */
#define ITT_TO_STR_AUX(x) #x
diff --git a/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.c b/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.c
index 1b44011b5e3..0044e75b26c 100644
--- a/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.c
+++ b/openmp/runtime/src/thirdparty/ittnotify/ittnotify_static.c
@@ -119,7 +119,7 @@ static __itt_fini_ittlib_t* __itt_fini_ittlib_ptr = _N_(fini_ittlib);
#define ITT_STUB(api,type,name,args,params,ptr,group,format) \
static type api ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)) args;\
typedef type api ITT_JOIN(_N_(name),_t) args; \
-ITT_EXTERN_C ITT_JOIN(_N_(name),_t)* ITTNOTIFY_NAME(name) = ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)); \
+ITT_EXTERN_C_BEGIN ITT_JOIN(_N_(name),_t)* ITTNOTIFY_NAME(name) = ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)); ITT_EXTERN_C_END \
static type api ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)) args \
{ \
__itt_init_ittlib_name(NULL, __itt_group_all); \
@@ -132,7 +132,7 @@ static type api ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)) args \
#define ITT_STUBV(api,type,name,args,params,ptr,group,format) \
static type api ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)) args;\
typedef type api ITT_JOIN(_N_(name),_t) args; \
-ITT_EXTERN_C ITT_JOIN(_N_(name),_t)* ITTNOTIFY_NAME(name) = ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)); \
+ITT_EXTERN_C_BEGIN ITT_JOIN(_N_(name),_t)* ITTNOTIFY_NAME(name) = ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)); ITT_EXTERN_C_END \
static type api ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)) args \
{ \
__itt_init_ittlib_name(NULL, __itt_group_all); \
@@ -150,12 +150,12 @@ static type api ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)) args \
#define ITT_STUB(api,type,name,args,params,ptr,group,format) \
static type api ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)) args;\
typedef type api ITT_JOIN(_N_(name),_t) args; \
-ITT_EXTERN_C ITT_JOIN(_N_(name),_t)* ITTNOTIFY_NAME(name) = ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init));
+ITT_EXTERN_C_BEGIN ITT_JOIN(_N_(name),_t)* ITTNOTIFY_NAME(name) = ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)); ITT_EXTERN_C_END
#define ITT_STUBV(api,type,name,args,params,ptr,group,format) \
static type api ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)) args;\
typedef type api ITT_JOIN(_N_(name),_t) args; \
-ITT_EXTERN_C ITT_JOIN(_N_(name),_t)* ITTNOTIFY_NAME(name) = ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init));
+ITT_EXTERN_C_BEGIN ITT_JOIN(_N_(name),_t)* ITTNOTIFY_NAME(name) = ITT_VERSIONIZE(ITT_JOIN(_N_(name),_init)); ITT_EXTERN_C_END
#define __ITT_INTERNAL_INIT
#include "ittnotify_static.h"
OpenPOWER on IntegriCloud