Skip to content

Commit 9b78902

Browse files
committed
Fix "unreachable code" warning
1 parent 60f81a7 commit 9b78902

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

cpu.cpp

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -846,19 +846,24 @@ inline bool CPU_QueryARMv7()
846846
#if defined(__ANDROID__) && defined(__arm__)
847847
if (((android_getCpuFamily() & ANDROID_CPU_FAMILY_ARM) != 0) &&
848848
((android_getCpuFeatures() & ANDROID_CPU_ARM_FEATURE_ARMv7) != 0))
849+
# define LOCALRET true
849850
return true;
850851
#elif defined(__linux__) && defined(__arm__)
851852
if ((getauxval(AT_HWCAP) & HWCAP_ARMv7) != 0 ||
852853
(getauxval(AT_HWCAP) & HWCAP_NEON) != 0)
853-
return true;
854+
# define LOCALRET true
854855
#elif defined(__APPLE__) && defined(__arm__)
855856
// Apple hardware is ARMv7 or above.
856-
return true;
857+
# define LOCALRET true
857858
#elif defined(_WIN32) && defined(_M_ARM64)
858859
// Windows 10 ARM64 is only supported on Armv8a and above
859-
return true;
860+
# define LOCALRET true
860861
#endif
861-
return false;
862+
#ifndef LOCALRET
863+
# define LOCALRET false
864+
#endif
865+
return LOCALRET;
866+
#undef LOCALRET
862867
}
863868

864869
inline bool CPU_QueryNEON()

0 commit comments

Comments
 (0)