add SDL3 overrides
This commit is contained in:
parent
6126144f7c
commit
f3640ffa5f
21
external/SDL3/SDL_bits.h
vendored
21
external/SDL3/SDL_bits.h
vendored
@ -65,26 +65,6 @@ extern __inline int _SDL_bsr_watcom(Uint32);
|
|||||||
*/
|
*/
|
||||||
SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x)
|
SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x)
|
||||||
{
|
{
|
||||||
#if defined(__GNUC__) && (__GNUC__ >= 4 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4)) && !defined(__importc__)
|
|
||||||
/* Count Leading Zeroes builtin in GCC.
|
|
||||||
* http://gcc.gnu.org/onlinedocs/gcc-4.3.4/gcc/Other-Builtins.html
|
|
||||||
*/
|
|
||||||
if (x == 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return 31 - __builtin_clz(x);
|
|
||||||
#elif defined(__WATCOMC__) && defined(__386__)
|
|
||||||
if (x == 0) {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return _SDL_bsr_watcom(x);
|
|
||||||
#elif defined(_MSC_VER) && _MSC_VER >= 1400
|
|
||||||
unsigned long index;
|
|
||||||
if (_BitScanReverse(&index, x)) {
|
|
||||||
return (int)index;
|
|
||||||
}
|
|
||||||
return -1;
|
|
||||||
#else
|
|
||||||
/* Based off of Bit Twiddling Hacks by Sean Eron Anderson
|
/* Based off of Bit Twiddling Hacks by Sean Eron Anderson
|
||||||
* <seander@cs.stanford.edu>, released in the public domain.
|
* <seander@cs.stanford.edu>, released in the public domain.
|
||||||
* http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog
|
* http://graphics.stanford.edu/~seander/bithacks.html#IntegerLog
|
||||||
@ -109,7 +89,6 @@ SDL_FORCE_INLINE int SDL_MostSignificantBitIndex32(Uint32 x)
|
|||||||
}
|
}
|
||||||
|
|
||||||
return msbIndex;
|
return msbIndex;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
6161
external/SDL3/SDL_stdinc.h
vendored
Normal file
6161
external/SDL3/SDL_stdinc.h
vendored
Normal file
File diff suppressed because it is too large
Load Diff
Loading…
x
Reference in New Issue
Block a user