mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-21 05:09:34 -06:00
Fix FreeBSD build
This commit is contained in:
@ -20,7 +20,7 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/types.h>
|
||||
#ifdef __APPLE__
|
||||
#if defined __APPLE__ || defined __FreeBSD__
|
||||
#include <sys/sysctl.h>
|
||||
#else
|
||||
#include <sys/sysinfo.h>
|
||||
@ -256,11 +256,15 @@ size_t MemPhysical()
|
||||
memInfo.dwLength = sizeof(MEMORYSTATUSEX);
|
||||
GlobalMemoryStatusEx(&memInfo);
|
||||
return memInfo.ullTotalPhys;
|
||||
#elif defined(__APPLE__)
|
||||
#elif defined __APPLE__ || defined __FreeBSD__
|
||||
int mib[2];
|
||||
size_t physical_memory;
|
||||
mib[0] = CTL_HW;
|
||||
#ifdef __APPLE__
|
||||
mib[1] = HW_MEMSIZE;
|
||||
#elif defined __FreeBSD__
|
||||
mib[1] = HW_REALMEM;
|
||||
#endif
|
||||
size_t length = sizeof(size_t);
|
||||
sysctl(mib, 2, &physical_memory, &length, NULL, 0);
|
||||
return physical_memory;
|
||||
|
Reference in New Issue
Block a user