6fb3699fcb
Libretro is a simple but powerful development interface that allows for the easy creation of emulators, games and multimedia applications that can plug straight into any libretro-compatible frontend. This development interface is open to others so that they can run these pluggable emulator and game cores also in their own programs or devices. mGBA is an emulator for running Game Boy Advance games. It aims to be faster and more accurate than many existing Game Boy Advance emulators, as well as adding features that other emulators lack. It also supports Game Boy and Game Boy Color games.
22 lines
632 B
C
22 lines
632 B
C
$NetBSD: patch-include_mgba-util_math.h,v 1.1 2018/08/12 14:25:09 nia Exp $
|
|
|
|
NetBSD defines popcount32 in libc.
|
|
|
|
--- include/mgba-util/math.h.orig 2017-07-16 19:04:50.000000000 +0000
|
|
+++ include/mgba-util/math.h
|
|
@@ -10,11 +10,15 @@
|
|
|
|
CXX_GUARD_START
|
|
|
|
+#ifndef __NetBSD__
|
|
static inline uint32_t popcount32(unsigned bits) {
|
|
bits = bits - ((bits >> 1) & 0x55555555);
|
|
bits = (bits & 0x33333333) + ((bits >> 2) & 0x33333333);
|
|
return (((bits + (bits >> 4)) & 0xF0F0F0F) * 0x1010101) >> 24;
|
|
}
|
|
+#else
|
|
+unsigned int popcount32(uint32_t);
|
|
+#endif
|
|
|
|
static inline unsigned clz32(uint32_t bits) {
|
|
#if defined(__GNUC__) || __clang__
|