#Source0Download: https://github.com/icculus/SDL_sound/releases
Source0: https://github.com/icculus/SDL_sound/archive/v%{version}/SDL_sound-%{version}.tar.gz
# Source0-md5: 4917a87b45f7b940a68cd1b60881cabb
+Patch0: SDL_sound-use-builtin-clz.patch
URL: http://www.icculus.org/SDL_sound/
BuildRequires: SDL2-devel >= 2.0
BuildRequires: cmake >= 2.8.12
%prep
%setup -q -n SDL_sound-%{version}
+%patch0 -p1
%build
install -d build
--- /dev/null
+--- SDL_sound-2.0.1/src/dr_flac.h.orig 2022-03-25 21:17:50.000000000 +0100
++++ SDL_sound-2.0.1/src/dr_flac.h 2022-09-24 20:46:30.681153334 +0200
+@@ -2768,25 +2768,7 @@ static DRFLAC_INLINE drflac_uint32 drfla
+ #endif
+ #else
+ #if defined(__GNUC__) || defined(__clang__)
+- #if defined(DRFLAC_X64)
+- {
+- drflac_uint64 r;
+- __asm__ __volatile__ (
+- "lzcnt{ %1, %0| %0, %1}" : "=r"(r) : "r"(x) : "cc"
+- );
+-
+- return (drflac_uint32)r;
+- }
+- #elif defined(DRFLAC_X86)
+- {
+- drflac_uint32 r;
+- __asm__ __volatile__ (
+- "lzcnt{l %1, %0| %0, %1}" : "=r"(r) : "r"(x) : "cc"
+- );
+-
+- return r;
+- }
+- #elif defined(DRFLAC_ARM) && (defined(__ARM_ARCH) && __ARM_ARCH >= 5) && !defined(DRFLAC_64BIT) /* <-- I haven't tested 64-bit inline assembly, so only enabling this for the 32-bit build for now. */
++ #if defined(DRFLAC_ARM) && (defined(__ARM_ARCH) && __ARM_ARCH >= 5) && !defined(DRFLAC_64BIT) /* <-- I haven't tested 64-bit inline assembly, so only enabling this for the 32-bit build for now. */
+ {
+ unsigned int r;
+ __asm__ __volatile__ (