Fix some pedantic warnings when compiling with GCC.

This commit is contained in:
David Reid
2023-03-25 09:10:28 +10:00
parent 315087be30
commit 58855d3d34
2 changed files with 12 additions and 0 deletions
+1
View File
@@ -1,5 +1,6 @@
v0.11.12 - TBD
=====================
* Fix some pedantic warnings when compiling with GCC.
* A safety change for custom VFS implementations. The `pBytesRead` parameter on the onRead callback is now pre-initialized to zero.
+11
View File
@@ -3799,7 +3799,18 @@ typedef double ma_double;
typedef void* ma_handle;
typedef void* ma_ptr;
/*
ma_proc is annoying because when compiling with GCC we get pendantic warnings about converting
between `void*` and `void (*)()`. We can't use `void (*)()` with MSVC however, because we'll get
warning C4191 about "type cast between incompatible function types". To work around this I'm going
to use a different data type depending on the compiler.
*/
#if defined(__GNUC__)
typedef void (*ma_proc)(void);
#else
typedef void* ma_proc;
#endif
#if defined(_MSC_VER) && !defined(_WCHAR_T_DEFINED)
typedef ma_uint16 wchar_t;