mirror of
https://github.com/mackron/miniaudio.git
synced 2026-04-22 00:06:59 +02:00
Fix potential warnings when compiling with GCC.
This commit is contained in:
+12
-3
@@ -571,12 +571,21 @@ typedef ma_uint16 wchar_t;
|
||||
|
||||
#ifdef _MSC_VER
|
||||
#define MA_INLINE __forceinline
|
||||
#else
|
||||
#ifdef __GNUC__
|
||||
#elif defined(__GNUC__)
|
||||
/*
|
||||
I've had a bug report where GCC is emitting warnings about functions possibly not being inlineable. This warning happens when
|
||||
the __attribute__((always_inline)) attribute is defined without an "inline" statement. I think therefore there must be some
|
||||
case where "__inline__" is not always defined, thus the compiler emitting these warnings. When using -std=c89 or -ansi on the
|
||||
command line, we cannot use the "inline" keyword and instead need to use "__inline__". In an attempt to work around this issue
|
||||
I am using "__inline__" only when we're compiling in strict ANSI mode.
|
||||
*/
|
||||
#if defined(__STRICT_ANSI__)
|
||||
#define MA_INLINE __inline__ __attribute__((always_inline))
|
||||
#else
|
||||
#define MA_INLINE
|
||||
#define MA_INLINE inline __attribute__((always_inline))
|
||||
#endif
|
||||
#else
|
||||
#define MA_INLINE
|
||||
#endif
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
|
||||
Reference in New Issue
Block a user