-
Notifications
You must be signed in to change notification settings - Fork 12
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 using wxLauncher with wxwidgets 3.2 #173
base: master
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
FreeSpace Open uses a SIZE_T_ARG
macro that is defined on a per-platform basis, like so:
in clang.h, doxygen.h, gcc.h, mingw.h:
#define SIZE_T_ARG "%zu"
in msvc.h:
#define SIZE_T_ARG "%Iu"
Is that an option?
Good question; I think what's happening there is that Visual Studio didn't support the In the case of the format strings in this PR though, they're going to logging functions from wxWidgets, and they don't seem to get passed through directly to the platform printf like functions. According to the wxWidgets changelog, support for the That said, we could perhaps create a macro that uses |
Hey @Goober5000, did you have an opinion on what way you wanted me to resolve your feedback? P.S. Thanks for your quick response when I initially opened this PR, and my others! I really appreciate that somebody is still helping to maintain this project. Khronoss is cool, but it's still in relatively early stages and wxLauncher is more reliable for now. |
Sorry, I've been having a pretty busy month! I just took a look at your comment and I'm happy to go with the original version of the PR. The important thing was to make sure we had all available information on which to make a decision. We don't need to create a macro that uses |
I was trying to compile wxLauncher with wxwidgets 3.2 (wxgtk3 to be specific). I was hitting this compilation error:
This appears to be because the the ModInfoDialog class inherits from wxDialog, but does so privately. Changing the code to inherit publicly allows wxLauncher to compile with wxwidgets 3.2.
Though this compiles, running the code I encountered assertion errors about argument types not being correct. I tracked them down to some logging calls where the
%d
format specifier was being used for arguments with the typesize_t
.size_t
is always an unsigned type, but the length varies based on the platform. In theory the fix here is to use a format specifier of%zu
, which specifies an unsigned integer with the same length assize_t
. However, thez
length specifier was only added in wxWidgets 3.1.0, so using it in this case would not maintain compatibility. However, the actual values in these cases will be relatively small, plenty small enough to be held in a regular unsigned integer; therefore I cast them tounsigned
and change the specifier to%u
.