From 8c53756cac94ca9a876b5f80bfb116e2aeb7749f Mon Sep 17 00:00:00 2001 From: David Reid Date: Sat, 11 Nov 2017 18:21:36 +1000 Subject: [PATCH] Clean up some GCC warnings for the BSD build. --- mini_al.h | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/mini_al.h b/mini_al.h index 062aa2c5..3e6b30ef 100644 --- a/mini_al.h +++ b/mini_al.h @@ -1518,7 +1518,11 @@ typedef HWND (WINAPI * MAL_PFN_GetDesktopWindow)(); #define mal_buffer_frame_capacity(buffer, channels, format) (sizeof(buffer) / mal_get_sample_size_in_bytes(format) / (channels)) - +// Some of these string utility functions are unused on some platforms. +#if defined(__GNUC__) + #pragma GCC diagnostic push + #pragma GCC diagnostic ignored "-Wunused-function" +#endif // Return Values: // 0: Success // 22: EINVAL @@ -1713,6 +1717,9 @@ static int mal_strcmp(const char* str1, const char* str2) return ((unsigned char*)str1)[0] - ((unsigned char*)str2)[0]; } +#if defined(__GNUC__) + #pragma GCC diagnostic pop +#endif // Thanks to good old Bit Twiddling Hacks for this one: http://graphics.stanford.edu/~seander/bithacks.html#RoundUpPowerOf2