From 07488662df250cdbc3ecf530b1b467b9433e56e2 Mon Sep 17 00:00:00 2001 From: Daniel Stevens Date: Sat, 1 Mar 2025 18:35:30 -0700 Subject: [PATCH] Convert `Mix_Music` forward declare to include in `Music.h` The `Mix_Music` typedef points to a `struct` that was renamed. There's no easy way to deal with that and maintain a forward declare. We would need to forward declare for one of two possible type names, before we've seen the include that would tell us which name it should be. I suppose we could add some pointer casting, but that should be avoided. Considering how infrequently the `Music.h` header is included by other files, we're probably fine doing a full SDL include for now. Once things have stabilized on the new version we could eventually switch back to a forward declare. As a bonus, that forward declare will then be for a name that is not reserved. --- NAS2D/Resource/Music.cpp | 6 ------ NAS2D/Resource/Music.h | 7 +++++-- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/NAS2D/Resource/Music.cpp b/NAS2D/Resource/Music.cpp index 3519025d..ee3fe7fe 100644 --- a/NAS2D/Resource/Music.cpp +++ b/NAS2D/Resource/Music.cpp @@ -14,12 +14,6 @@ #include -#if defined(__XCODE_BUILD__) -#include -#else -#include -#endif - #include #include diff --git a/NAS2D/Resource/Music.h b/NAS2D/Resource/Music.h index 38994b75..ba4da2e1 100644 --- a/NAS2D/Resource/Music.h +++ b/NAS2D/Resource/Music.h @@ -13,8 +13,11 @@ #include #include - -typedef struct _Mix_Music Mix_Music; +#if defined(__XCODE_BUILD__) +#include +#else +#include +#endif namespace NAS2D