aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2018-02-25 13:14:14 -0800
committerChris Robinson <[email protected]>2018-02-25 13:14:14 -0800
commitd25398d2c7efb02a9b8e630b15be3a7ab2578aa8 (patch)
tree26a47d2fc8caf7c6f9c9d29013611ca63245e452
parent654a45833acb4ba3eb6c71906346fcd60034cb41 (diff)
Avoid using static inline in headers
-rw-r--r--Alc/helpers.c10
-rw-r--r--OpenAL32/Include/alMain.h8
2 files changed, 14 insertions, 4 deletions
diff --git a/Alc/helpers.c b/Alc/helpers.c
index 45e137fd..6de1fdc3 100644
--- a/Alc/helpers.c
+++ b/Alc/helpers.c
@@ -121,6 +121,16 @@ DEFINE_PROPERTYKEY(PKEY_AudioEndpoint_GUID, 0x1da5d803, 0xd492, 0x4edd, 0x8c, 0x
extern inline ALuint NextPowerOf2(ALuint value);
extern inline size_t RoundUp(size_t value, size_t r);
extern inline ALint fastf2i(ALfloat f);
+#ifndef __GNUC__
+#if defined(HAVE_BITSCANFORWARD64_INTRINSIC)
+extern inline int msvc64_ctz64(ALuint64 v);
+#elif defined(HAVE_BITSCANFORWARD_INTRINSIC)
+extern inline int msvc_ctz64(ALuint64 v);
+#else
+extern inline int fallback_popcnt64(ALuint64 v);
+extern inline int fallback_ctz64(ALuint64 value);
+#endif
+#endif
int CPUCapFlags = 0;
diff --git a/OpenAL32/Include/alMain.h b/OpenAL32/Include/alMain.h
index 8c2615cf..1726cb37 100644
--- a/OpenAL32/Include/alMain.h
+++ b/OpenAL32/Include/alMain.h
@@ -99,7 +99,7 @@ typedef ALuint64SOFT ALuint64;
#elif defined(HAVE_BITSCANFORWARD64_INTRINSIC)
-static inline int msvc64_ctz64(ALuint64 v)
+inline int msvc64_ctz64(ALuint64 v)
{
unsigned long idx = 64;
_BitScanForward64(&idx, v);
@@ -109,7 +109,7 @@ static inline int msvc64_ctz64(ALuint64 v)
#elif defined(HAVE_BITSCANFORWARD_INTRINSIC)
-static inline int msvc_ctz64(ALuint64 v)
+inline int msvc_ctz64(ALuint64 v)
{
unsigned long idx = 64;
if(!_BitScanForward(&idx, v&0xffffffff))
@@ -130,7 +130,7 @@ static inline int msvc_ctz64(ALuint64 v)
* as the ntz2 variant. These likely aren't the most efficient methods, but
* they're good enough if the GCC or MSVC intrinsics aren't available.
*/
-static inline int fallback_popcnt64(ALuint64 v)
+inline int fallback_popcnt64(ALuint64 v)
{
v = v - ((v >> 1) & U64(0x5555555555555555));
v = (v & U64(0x3333333333333333)) + ((v >> 2) & U64(0x3333333333333333));
@@ -138,7 +138,7 @@ static inline int fallback_popcnt64(ALuint64 v)
return (int)((v * U64(0x0101010101010101)) >> 56);
}
-static inline int fallback_ctz64(ALuint64 value)
+inline int fallback_ctz64(ALuint64 value)
{
return fallback_popcnt64(~value & (value - 1));
}