Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2022-01-13 16:52:31 +0300
committerJulian Eisel <julian@blender.org>2022-01-13 19:01:47 +0300
commit1a4f8ab38934891e76a56a5c31be02b934f68162 (patch)
tree6a14ef2aabe4e798004f16e0e55f00b424d53bb7
parentf173973ae461bc1be0f2b12b366ca82b9f3c2077 (diff)
Cleanup: Make message-bus utility macros callable from C++
C++ doesn't support compound literals like used here (GCC does via an extension).
-rw-r--r--source/blender/windowmanager/message_bus/wm_message_bus.h32
1 files changed, 12 insertions, 20 deletions
diff --git a/source/blender/windowmanager/message_bus/wm_message_bus.h b/source/blender/windowmanager/message_bus/wm_message_bus.h
index 7ee2e5b6ee6..e9f99979e93 100644
--- a/source/blender/windowmanager/message_bus/wm_message_bus.h
+++ b/source/blender/windowmanager/message_bus/wm_message_bus.h
@@ -270,16 +270,11 @@ void WM_msg_publish_ID(struct wmMsgBus *mbus, struct ID *id);
/* Anonymous variants (for convenience) */
#define WM_msg_subscribe_rna_anon_type(mbus, type_, value) \
{ \
- WM_msg_subscribe_rna_params(mbus, \
- &(const wmMsgParams_RNA){ \
- .ptr = \
- (PointerRNA){ \
- .type = &RNA_##type_, \
- }, \
- .prop = NULL, \
- }, \
- value, \
- __func__); \
+ PointerRNA msg_ptr_ = {0, &RNA_##type_}; \
+ wmMsgParams_RNA msg_key_params_ = {{0}}; \
+ msg_key_params_.ptr = msg_ptr_; \
+\
+ WM_msg_subscribe_rna_params(mbus, &msg_key_params_, value, __func__); \
} \
((void)0)
#define WM_msg_subscribe_rna_anon_prop(mbus, type_, prop_, value) \
@@ -287,16 +282,13 @@ void WM_msg_publish_ID(struct wmMsgBus *mbus, struct ID *id);
_WM_MESSAGE_EXTERN_BEGIN; \
extern PropertyRNA rna_##type_##_##prop_; \
_WM_MESSAGE_EXTERN_END; \
- WM_msg_subscribe_rna_params(mbus, \
- &(const wmMsgParams_RNA){ \
- .ptr = \
- (PointerRNA){ \
- .type = &RNA_##type_, \
- }, \
- .prop = &rna_##type_##_##prop_, \
- }, \
- value, \
- __func__); \
+\
+ PointerRNA msg_ptr_ = {0, &RNA_##type_}; \
+ wmMsgParams_RNA msg_key_params_ = {{0}}; \
+ msg_key_params_.ptr = msg_ptr_; \
+ msg_key_params_.prop = &rna_##type_##_##prop_; \
+\
+ WM_msg_subscribe_rna_params(mbus, &msg_key_params_, value, __func__); \
} \
((void)0)