Commit 4ad67a66 authored by David Reid's avatar David Reid

Fix potential warnings when compiling with GCC.

parent 662246ce
...@@ -570,13 +570,22 @@ typedef ma_uint16 wchar_t; ...@@ -570,13 +570,22 @@ typedef ma_uint16 wchar_t;
#ifdef _MSC_VER #ifdef _MSC_VER
#define MA_INLINE __forceinline #define MA_INLINE __forceinline
#else #elif defined(__GNUC__)
#ifdef __GNUC__ /*
#define MA_INLINE __inline__ __attribute__((always_inline)) 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 inline __attribute__((always_inline))
#endif
#else #else
#define MA_INLINE #define MA_INLINE
#endif
#endif #endif
#if defined(_MSC_VER) #if defined(_MSC_VER)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment