qoa icon indicating copy to clipboard operation
qoa copied to clipboard

Add type casts to MALLOC calls

Open DeeJayLSP opened this issue 2 years ago • 3 comments

Fixes a few errors that can be bypassed with -fpermissive in C++ projects. Does not affect C.

DeeJayLSP avatar Sep 09 '23 05:09 DeeJayLSP

Rebased so it sticks to a single change.

DeeJayLSP avatar Sep 29 '23 03:09 DeeJayLSP

I can confirm this patch works (tested on Windows, Xbox, PlayStation, and Switch platforms) and is useful. Makes it possible to embed QOA in a C++ project, because extern "C" is not enough and will not work. Could it be applied, please?

samhocevar avatar Mar 11 '25 15:03 samhocevar

FYI, for the time being, our workaround is to compile the QOA implementation as C even if the project is C++, so we have this single qoa-impl.c file that contains only this:

#define QOA_IMPLEMENTATION
#include "../3rdparty/qoa/qoa.h"

samhocevar avatar Mar 12 '25 11:03 samhocevar