Closed sonoro1234 closed 2 years ago
It seems that adding struct keyword solves the ambiguity
#ifndef CIMGUI_DEFINE_ENUMS_AND_STRUCTS
typedef struct ImNodesIO::EmulateThreeButtonMouse EmulateThreeButtonMouse;
typedef struct ImNodesIO::LinkDetachWithModifierClick LinkDetachWithModifierClick;
#endif //CIMGUI_DEFINE_ENUMS_AND_STRUCTS
Hi,
Having the struct tag EmulateThreeButtonMouse equal to the field name EmulateThreeButtonMouse makes a problem for cimnodes:
Change was introduced when emulate_three_button_mouse was renamed to EmulateThreeButtonMouse
this is used in cimnodes.h so that EmulateThreeButtonMouse can be used as a type from both C and C++:
with CIMGUI_DEFINE_ENUMS_AND_STRUCTS defined for C usage and without it for C++ usage
but that makes cpp compiler complain
The same happens with LinkDetachWithModifierClick Problem disappears if both tag name and field name are different. I am not able to solve it myself
The worst part for imnodes code is that changing the tag name makes necessary to change the constructor name also: if tag is EmulateThreeButtonMouse for example then constructor should be EmulateThreeButtonMouse () (But perhaps end user is not expected to use this constructor)