From 3b1808cc8fc19fca1545967647a2890ce855baf8 Mon Sep 17 00:00:00 2001 From: ISSOtm Date: Thu, 10 Mar 2022 21:01:55 +0100 Subject: [PATCH] Fix Windows-breaking use of `struct` vs `class` MSVC's (broken) ABI breaks otherwise. What the f@!$#ck, Microsoft? (Thank you based Clang for warning, by the way.) --- include/gfx/pal_packing.hpp | 2 +- include/gfx/pal_sorting.hpp | 2 +- src/gfx/convert.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/gfx/pal_packing.hpp b/include/gfx/pal_packing.hpp index 997fe66b..d208866e 100644 --- a/include/gfx/pal_packing.hpp +++ b/include/gfx/pal_packing.hpp @@ -16,7 +16,7 @@ #include "gfx/main.hpp" -class Palette; +struct Palette; class ProtoPalette; namespace packing { diff --git a/include/gfx/pal_sorting.hpp b/include/gfx/pal_sorting.hpp index 8acd1edb..70f5b714 100644 --- a/include/gfx/pal_sorting.hpp +++ b/include/gfx/pal_sorting.hpp @@ -17,7 +17,7 @@ #include "gfx/rgba.hpp" -class Palette; +struct Palette; namespace sorting { diff --git a/src/gfx/convert.cpp b/src/gfx/convert.cpp index 21475cf4..70359888 100644 --- a/src/gfx/convert.cpp +++ b/src/gfx/convert.cpp @@ -77,19 +77,19 @@ class Png { png_bytep transparencyPal = nullptr; [[noreturn]] static void handleError(png_structp png, char const *msg) { - struct Png *self = reinterpret_cast(png_get_error_ptr(png)); + Png *self = reinterpret_cast(png_get_error_ptr(png)); fatal("Error reading input image (\"%s\"): %s", self->path.c_str(), msg); } static void handleWarning(png_structp png, char const *msg) { - struct Png *self = reinterpret_cast(png_get_error_ptr(png)); + Png *self = reinterpret_cast(png_get_error_ptr(png)); warning("In input image (\"%s\"): %s", self->path.c_str(), msg); } static void readData(png_structp png, png_bytep data, size_t length) { - struct Png *self = reinterpret_cast(png_get_io_ptr(png)); + Png *self = reinterpret_cast(png_get_io_ptr(png)); std::streamsize expectedLen = length; std::streamsize nbBytesRead = self->file.sgetn(reinterpret_cast(data), expectedLen);