From 800fc17367480b82e07570d5234726aa61c38563 Mon Sep 17 00:00:00 2001 From: Julian Eisel Date: Thu, 13 Jan 2022 20:40:52 +0100 Subject: 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. --- source/blender/editors/space_outliner/outliner_collections.cc | 3 +++ source/blender/editors/space_outliner/outliner_draw.cc | 3 +++ source/blender/editors/space_outliner/outliner_tools.cc | 3 +++ source/blender/editors/space_outliner/space_outliner.cc | 3 +++ 4 files changed, 12 insertions(+) (limited to 'source/blender/editors') diff --git a/source/blender/editors/space_outliner/outliner_collections.cc b/source/blender/editors/space_outliner/outliner_collections.cc index 9fc841fcba9..e4c4d41a04b 100644 --- a/source/blender/editors/space_outliner/outliner_collections.cc +++ b/source/blender/editors/space_outliner/outliner_collections.cc @@ -385,6 +385,8 @@ void outliner_collection_delete( BLI_gset_free(data.collections_to_edit, nullptr); } +/* FIXME: See comment above #WM_msg_publish_rna_prop(). */ +extern "C" { static int collection_hierarchy_delete_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); @@ -408,6 +410,7 @@ static int collection_hierarchy_delete_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } +} void OUTLINER_OT_collection_hierarchy_delete(wmOperatorType *ot) { diff --git a/source/blender/editors/space_outliner/outliner_draw.cc b/source/blender/editors/space_outliner/outliner_draw.cc index 9c522effa5e..3d29f1762ec 100644 --- a/source/blender/editors/space_outliner/outliner_draw.cc +++ b/source/blender/editors/space_outliner/outliner_draw.cc @@ -668,6 +668,8 @@ static void scenes__collection_set_flag_recursive_fn(bContext *C, void *poin, vo outliner_collection_set_flag_recursive_fn(C, nullptr, collection, propname); } +/* FIXME: See comment above #WM_msg_publish_rna_prop(). */ +extern "C" { static void namebutton_fn(bContext *C, void *tsep, char *oldname) { Main *bmain = CTX_data_main(C); @@ -865,6 +867,7 @@ static void namebutton_fn(bContext *C, void *tsep, char *oldname) tselem->flag &= ~TSE_TEXTBUT; } } +} typedef struct RestrictProperties { bool initialized; diff --git a/source/blender/editors/space_outliner/outliner_tools.cc b/source/blender/editors/space_outliner/outliner_tools.cc index 097d7181c99..89d35f54e8c 100644 --- a/source/blender/editors/space_outliner/outliner_tools.cc +++ b/source/blender/editors/space_outliner/outliner_tools.cc @@ -1686,6 +1686,8 @@ static TreeTraversalAction outliner_find_objects_to_delete(TreeElement *te, void return TRAVERSE_CONTINUE; } +/* FIXME: See comment above #WM_msg_publish_rna_prop(). */ +extern "C" { static int outliner_delete_exec(bContext *C, wmOperator *op) { Main *bmain = CTX_data_main(C); @@ -1745,6 +1747,7 @@ static int outliner_delete_exec(bContext *C, wmOperator *op) return OPERATOR_FINISHED; } +} void OUTLINER_OT_delete(wmOperatorType *ot) { diff --git a/source/blender/editors/space_outliner/space_outliner.cc b/source/blender/editors/space_outliner/space_outliner.cc index ea6ecbfe84c..d3a78425242 100644 --- a/source/blender/editors/space_outliner/space_outliner.cc +++ b/source/blender/editors/space_outliner/space_outliner.cc @@ -262,6 +262,8 @@ static void outliner_main_region_listener(const wmRegionListenerParams *params) } } +/* FIXME: See comment above #WM_msg_publish_rna_prop(). */ +extern "C" { static void outliner_main_region_message_subscribe(const wmRegionMessageSubscribeParams *params) { struct wmMsgBus *mbus = params->message_bus; @@ -278,6 +280,7 @@ static void outliner_main_region_message_subscribe(const wmRegionMessageSubscrib WM_msg_subscribe_rna_anon_prop(mbus, Window, view_layer, &msg_sub_value_region_tag_redraw); } } +} /* ************************ header outliner area region *********************** */ -- cgit v1.2.3