Closed smcv closed 1 year ago
If the sdl12-compat maintainers prefer to reject this PR as "SDLmm is wrong, sdl12-compat is already fine" then the change to fix compilation of asc should be as simple as deleting the hwdata accessor, which asc never calls anyway.
Confirmed: deleting the accessor is enough to make SDLmm and asc compile successfully against sdl12-compat headers.
There's no reason not to have complete source compatibility with SDL 1.2. I'll go ahead and merge this. Thanks!
Classic SDL 1.2 headers traditionally had this member as a pointer to the incomplete type
struct private_hwdata
. For whatever reason (presumably a sense of completeness) the SDLmm C++ binding[1] that is bundled in Debian package 'asc' (Advanced Strategic Command) defines an accessor for it, which is declared as returningstruct private_hwdata *
and has the obvious trivial implementation[2].Implicit conversion from
void *
tostruct private_hwdata *
is allowed in C, but not in C++, so sdl12-classic's simplification of changing this member fromstruct private_hwdata *
tovoid *
breaks the build for SDLmm.Arguably it's a bug that SDLmm has this accessor, because this member is for internal use by SDL and its type has no public definition, so there's no legitimate reason for third-party code to call the accessor; but it does exist, so 100% source compatibility with classic SDL 1.2 would require it to have the same type it historically had.
[1] https://sourceforge.net/projects/sdlmm/
[2] https://sourceforge.net/p/sdlmm/code/HEAD/tree/trunk/SDLmm/src/sdlmm_basesurface.h#l141
Resolves: https://github.com/libsdl-org/sdl12-compat/issues/299
If the sdl12-compat maintainers prefer to reject this PR as "SDLmm is wrong, sdl12-compat is already fine" then the change to fix compilation of asc should be as simple as deleting the
hwdata
accessor, which asc never calls anyway.