summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon McVittie <smcv@debian.org>2023-06-27 11:25:46 +0100
committerSimon McVittie <smcv@debian.org>2023-06-29 10:55:32 +0100
commitcac4e9e06b94b940d24bc644e2505ddabe1c7ef5 (patch)
tree4c98b20d28be6743a924cda37d1aa86a4acab95a
parent406af0b294159d49c15dfe07d6ff08e3af68cb63 (diff)
include: Use `struct private_hwdata` incomplete type for API compat
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 returning `struct private_hwdata *` and has the obvious trivial implementation[2]. Implicit conversion from `void *` to `struct private_hwdata *` is allowed in C, but not in C++, so sdl12-classic's simplification of changing this member from `struct private_hwdata *` to `void *` 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 Signed-off-by: Simon McVittie <smcv@debian.org> Forwarded: https://github.com/libsdl-org/sdl12-compat/pull/300 Applied-upstream: 1.2.66, commit:ed188b5e24fc33190e3eeada5e26f5d295f50948 Bug-Debian: https://bugs.debian.org/1039439 Gbp-Pq: Name include-Use-struct-private_hwdata-incomplete-type-for-API.patch
-rw-r--r--include/SDL/SDL_video.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/SDL/SDL_video.h b/include/SDL/SDL_video.h
index 67db723..d9e9069 100644
--- a/include/SDL/SDL_video.h
+++ b/include/SDL/SDL_video.h
@@ -89,7 +89,7 @@ typedef struct SDL_Surface
Uint16 pitch;
void *pixels;
int offset;
- void *hwdata;
+ struct private_hwdata *hwdata;
SDL_Rect clip_rect;
Uint32 unused1;
Uint32 locked;