-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix issues with Windows and the Interconnect library #51
Comments
Do you mean bugs in |
In the application. It'll result in a differently named signal being called, triggering completely different slots from what you'd expect. |
What do you think about
|
Interesting, didn't know about The main problem is I don't like the macro :( If I compare to |
Who likes macros? But what if a macro had a bonus - by making signal declarations less verbose, something like
Which variant takes more memory cannot be said for sure until measured and most likely the result will vary from application to application. Also, probably the macro can be optimized to use
Some will interpret such a restriction as a library defect! |
I don't think the current signal declarations are verbose, quite the contrary. Using a macro like you suggest, in my opinion, would make things overly opaque and prevent signal name/signature autocompletion in "less gifted" IDEs. Moreover, the current design allows for extra flexibility -- turning references into copies, having default arguments for signals etc. I see |
Finally got around to fixing this:
Regarding MinGW, everything in the tests was "just working" with the current state, so I assume all works correctly there. If not, that'll get handled in a separate issue, since problems described here are fairly MSVC-specific. |
In case anybody is still subscribed to this issue: I managed to reproduce and test for the MinGW-specific bug in #72, the Ui library has a |
Currently, in case two signals have the same signature (such as the StateMachine::stepped() templated signal or Ui::UserInterface::inputWidgetFocused() and
inputWidgetBlurred()
pair of signals, MSVC merges them in Release mode when the/OPT:ICF
flag is enabled as their codegen is the same. That's very unfortunate and leads to nasty hard-to-prevent bugs.Presently, there are the following options, none of which is ideal:
/OPT:NOICF
. That'll prevent some useful optimizations elsewhere and again needs to be done by the users as CMake < 3.13 doesn't support INTERFACE_LINK_OPTIONS. Even with CMake 3.13, users with custom buildsystems will have issues because this flag won't get enabled for them automatically. (Note: it might be useful to say/OPT:REF,NOICF
instead (source).)emit()
API. One idea I have is to replace it with aCORRADE_EMIT()
macro that has__COUNTER__
inside, which then will get saved to an internal member of the Emitter class. This won't solve it for templated signals, though -- the user would again need to create a unique numeric identifier for these (typeid? something?).printf()
insideemit()
would work? Some inline assembly?In total, there are the following Windows-specific issues:
/OPT:ICF
issuevirtual
(might help casting the signal pointer to an unknown type to expand it to its full size)Signal with multiple inheritance don't seem to work at all on MinGW, even with thecan't reproducevirtual
workaroundThe text was updated successfully, but these errors were encountered: