mirror of
https://github.com/gbdev/rgbds.git
synced 2025-11-20 10:12:06 +00:00
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:
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#include "gfx/main.hpp"
|
#include "gfx/main.hpp"
|
||||||
|
|
||||||
class Palette;
|
struct Palette;
|
||||||
class ProtoPalette;
|
class ProtoPalette;
|
||||||
|
|
||||||
namespace packing {
|
namespace packing {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
#include "gfx/rgba.hpp"
|
#include "gfx/rgba.hpp"
|
||||||
|
|
||||||
class Palette;
|
struct Palette;
|
||||||
|
|
||||||
namespace sorting {
|
namespace sorting {
|
||||||
|
|
||||||
|
|||||||
@@ -77,19 +77,19 @@ class Png {
|
|||||||
png_bytep transparencyPal = nullptr;
|
png_bytep transparencyPal = nullptr;
|
||||||
|
|
||||||
[[noreturn]] static void handleError(png_structp png, char const *msg) {
|
[[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);
|
fatal("Error reading input image (\"%s\"): %s", self->path.c_str(), msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void handleWarning(png_structp png, char const *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);
|
warning("In input image (\"%s\"): %s", self->path.c_str(), msg);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void readData(png_structp png, png_bytep data, size_t length) {
|
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 expectedLen = length;
|
||||||
std::streamsize nbBytesRead = self->file.sgetn(reinterpret_cast<char *>(data), expectedLen);
|
std::streamsize nbBytesRead = self->file.sgetn(reinterpret_cast<char *>(data), expectedLen);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user