[Bf-blender-cvs] [bf593a8631e] blender2.8: WM: quiet GCC redundant declaration warnings
Campbell Barton
noreply at git.blender.org
Tue May 8 07:28:02 CEST 2018
Commit: bf593a8631e84a258d1c8e5e7b198b458811c11b
Author: Campbell Barton
Date: Tue May 8 07:18:49 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBbf593a8631e84a258d1c8e5e7b198b458811c11b
WM: quiet GCC redundant declaration warnings
===================================================================
M source/blender/windowmanager/message_bus/wm_message_bus.h
===================================================================
diff --git a/source/blender/windowmanager/message_bus/wm_message_bus.h b/source/blender/windowmanager/message_bus/wm_message_bus.h
index a31137d353f..c1d6f1f6fb8 100644
--- a/source/blender/windowmanager/message_bus/wm_message_bus.h
+++ b/source/blender/windowmanager/message_bus/wm_message_bus.h
@@ -206,6 +206,17 @@ typedef struct wmMsgSubscribeKey_RNA {
wmMsg_RNA msg;
} wmMsgSubscribeKey_RNA;
+#ifdef __GNUC__
+#define _WM_MESSAGE_EXTERN_BEGIN \
+ _Pragma("GCC diagnostic push"); \
+ _Pragma("GCC diagnostic ignored \"-Wredundant-decls\"");
+#define _WM_MESSAGE_EXTERN_END \
+ _Pragma("GCC diagnostic pop");
+#else
+#define _WM_MESSAGE_EXTERN_BEGIN
+#define _WM_MESSAGE_EXTERN_END
+#endif
+
void WM_msgtypeinfo_init_rna(wmMsgTypeInfo *msg_type);
wmMsgSubscribeKey_RNA *WM_msg_lookup_rna(
@@ -236,14 +247,18 @@ void WM_msg_publish_ID(
#define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_) { \
wmMsgParams_RNA msg_key_params_ = {{{0}}}; \
+ _WM_MESSAGE_EXTERN_BEGIN; \
extern PropertyRNA rna_##type_##_##prop_; \
+ _WM_MESSAGE_EXTERN_END; \
RNA_pointer_create(id_, &RNA_##type_, data_, &msg_key_params_.ptr); \
msg_key_params_.prop = &rna_##type_##_##prop_; \
WM_msg_publish_rna_params(mbus, &msg_key_params_); \
} ((void)0)
#define WM_msg_subscribe_rna_prop(mbus, id_, data_, type_, prop_, value) { \
wmMsgParams_RNA msg_key_params_ = {{{0}}}; \
+ _WM_MESSAGE_EXTERN_BEGIN; \
extern PropertyRNA rna_##type_##_##prop_; \
+ _WM_MESSAGE_EXTERN_END; \
RNA_pointer_create(id_, &RNA_##type_, data_, &msg_key_params_.ptr); \
msg_key_params_.prop = &rna_##type_##_##prop_; \
WM_msg_subscribe_rna_params(mbus, &msg_key_params_, value, __func__); \
@@ -260,7 +275,9 @@ void WM_msg_publish_ID(
value, __func__); \
} ((void)0)
#define WM_msg_subscribe_rna_anon_prop(mbus, type_, prop_, value) { \
+ _WM_MESSAGE_EXTERN_BEGIN; \
extern PropertyRNA rna_##type_##_##prop_; \
+ _WM_MESSAGE_EXTERN_END; \
WM_msg_subscribe_rna_params( \
mbus, \
&(const wmMsgParams_RNA){ \
More information about the Bf-blender-cvs
mailing list