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.)
This commit is contained in:
ISSOtm
2022-03-10 21:01:55 +01:00
committed by Eldred Habert
parent 71cb2854e8
commit 3b1808cc8f
3 changed files with 5 additions and 5 deletions

View File

@@ -16,7 +16,7 @@
#include "gfx/main.hpp"
class Palette;
struct Palette;
class ProtoPalette;
namespace packing {

View File

@@ -17,7 +17,7 @@
#include "gfx/rgba.hpp"
class Palette;
struct Palette;
namespace sorting {

View File

@@ -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 *>(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);