richgel999 / miniz

miniz: Single C source file zlib-replacement library, originally from code.google.com/p/miniz
MIT License
2.2k stars 322 forks source link

mz_version() defined without prototype, causing warning, when MINIZ_NO_ZLIB_APIS defined #290

Open snej opened 11 months ago

snej commented 11 months ago

If MINIZ_NO_ZLIB_APIS is defined, the prototype for mz_version is skipped but the definition isn’t, leading to the following warning or error in Clang when -Wmissing-prototypes is enabled:

miniz/miniz.c:182:13: error: no previous prototype for function 'mz_version' [-Werror,-Wmissing-prototypes]
const char *mz_version(void)
            ^

Looks like this can be fixed by moving the following line #ifndef MINIZ_NO_ZLIB_APIS up above this definition.

[I am building the current master, i.e. commit 18795fa61e590521381ba9e1fa4a4ab362b095f6, on macOS with Xcode 15.0.]