Fix using wxLauncher with wxwidgets 3.2 #173
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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
%dformat specifier was being used for arguments with the typesize_t.size_tis 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, thezlength 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 tounsignedand change the specifier to%u.