shithub: rgbds

Download patch

ref: 3b1808cc8fc19fca1545967647a2890ce855baf8
parent: 71cb2854e8268a253c0a6e3181bea45ee32c771f
author: ISSOtm <eldredhabert0@gmail.com>
date: Thu Mar 10 16:01:55 EST 2022

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.)

--- 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 {
--- 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 {
 
--- a/src/gfx/convert.cpp
+++ b/src/gfx/convert.cpp
@@ -77,19 +77,19 @@
 	png_bytep transparencyPal = nullptr;
 
 	[[noreturn]] static void handleError(png_structp png, char const *msg) {
-		struct Png *self = reinterpret_cast<Png *>(png_get_error_ptr(png));
+		Png *self = reinterpret_cast<Png *>(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 *>(png_get_error_ptr(png));
+		Png *self = reinterpret_cast<Png *>(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 *>(png_get_io_ptr(png));
+		Png *self = reinterpret_cast<Png *>(png_get_io_ptr(png));
 		std::streamsize expectedLen = length;
 		std::streamsize nbBytesRead = self->file.sgetn(reinterpret_cast<char *>(data), expectedLen);