mirror of https://github.com/encounter/SDL.git
Fix to unbreak SDL_GetSystemRAM() on FreeBSD
Marcus von Appen Revision eecbcfed77c9 of the SDL hg repo introduces the new SDL_GetSystemRAM() function, which breaks the build on FreeBSD. Find attached a patch, which unbreaks the build and also should (for most cases) properly implement the sysctl support it.
This commit is contained in:
parent
14e13e13c4
commit
95dc9940a2
|
@ -620,7 +620,16 @@ SDL_GetSystemRAM(void)
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_SYSCTLBYNAME
|
#ifdef HAVE_SYSCTLBYNAME
|
||||||
if (SDL_SystemRAM <= 0) {
|
if (SDL_SystemRAM <= 0) {
|
||||||
|
#ifdef __FreeBSD__
|
||||||
|
#ifdef HW_REALMEM
|
||||||
|
int mib[2] = {CTL_HW, HW_REALMEM};
|
||||||
|
#else
|
||||||
|
/* might only report up to 2 GiB */
|
||||||
|
int mib[2] = {CTL_HW, HW_PHYSMEM};
|
||||||
|
#endif /* HW_REALMEM */
|
||||||
|
#else
|
||||||
int mib[2] = {CTL_HW, HW_MEMSIZE};
|
int mib[2] = {CTL_HW, HW_MEMSIZE};
|
||||||
|
#endif /* __FreeBSD__ */
|
||||||
Uint64 memsize = 0;
|
Uint64 memsize = 0;
|
||||||
size_t len = sizeof(memsize);
|
size_t len = sizeof(memsize);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue