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 22:40:52 +0300
committerJulian Eisel <julian@blender.org>2022-01-13 22:40:52 +0300
commit800fc17367480b82e07570d5234726aa61c38563 (patch)
tree4a00b76ac3b021bb7b6460f4865da3c0dab2122b /source/blender/windowmanager
parent1c4a1c13e04e51d00767fdb478a9957faae815e2 (diff)
Fix/workaround MSVC compile error with messag-bus
Some of the message-bus macros are not safe to use in C++. This has come up before, but no good solution was found. Now @LazyDodo, @HooglyBoogly and I concluded this is the best duct tape "solution" for the moment. The message-bus API should address this.
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r--source/blender/windowmanager/message_bus/wm_message_bus.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/windowmanager/message_bus/wm_message_bus.h b/source/blender/windowmanager/message_bus/wm_message_bus.h
index e9f99979e93..a93a7bbcea7 100644
--- a/source/blender/windowmanager/message_bus/wm_message_bus.h
+++ b/source/blender/windowmanager/message_bus/wm_message_bus.h
@@ -244,6 +244,17 @@ void WM_msg_subscribe_ID(struct wmMsgBus *mbus,
const char *id_repr);
void WM_msg_publish_ID(struct wmMsgBus *mbus, struct ID *id);
+/* FIXME
+ *
+ * For C++ code, some of the following macros need to be called in functions wrapped in
+ * `extern "C"` blocks. That is, the ones doing `extern PropertyRNA` declarations (trips up the
+ * MSVC linker).
+ * Although this shouldn't cause problems normally, if it does, the bits calling the macros can be
+ * moved to a separate function wrapped in `extern "C"`.
+ *
+ * Obviously this should be fixed properly (by not relying on inline `extern` declarations).
+ */
+
#define WM_msg_publish_rna_prop(mbus, id_, data_, type_, prop_) \
{ \
wmMsgParams_RNA msg_key_params_ = {{0}}; \