mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-24 14:49:42 -06:00
@ -20,7 +20,7 @@
|
||||
#include <stdio.h>
|
||||
#include <sys/mman.h>
|
||||
#include <sys/types.h>
|
||||
#if defined __APPLE__ || defined __FreeBSD__
|
||||
#if defined __APPLE__ || defined __FreeBSD__ || defined __OpenBSD__
|
||||
#include <sys/sysctl.h>
|
||||
#else
|
||||
#include <sys/sysinfo.h>
|
||||
@ -253,7 +253,7 @@ size_t MemPhysical()
|
||||
memInfo.dwLength = sizeof(MEMORYSTATUSEX);
|
||||
GlobalMemoryStatusEx(&memInfo);
|
||||
return memInfo.ullTotalPhys;
|
||||
#elif defined __APPLE__ || defined __FreeBSD__
|
||||
#elif defined __APPLE__ || defined __FreeBSD__ || defined __OpenBSD__
|
||||
int mib[2];
|
||||
size_t physical_memory;
|
||||
mib[0] = CTL_HW;
|
||||
@ -261,6 +261,8 @@ size_t MemPhysical()
|
||||
mib[1] = HW_MEMSIZE;
|
||||
#elif defined __FreeBSD__
|
||||
mib[1] = HW_REALMEM;
|
||||
#elif defined __OpenBSD__
|
||||
mib[1] = HW_PHYSMEM;
|
||||
#endif
|
||||
size_t length = sizeof(size_t);
|
||||
sysctl(mib, 2, &physical_memory, &length, NULL, 0);
|
||||
|
@ -28,7 +28,7 @@
|
||||
#include <locale.h>
|
||||
#endif
|
||||
|
||||
#if !defined(_WIN32) && !defined(ANDROID)
|
||||
#if !defined(_WIN32) && !defined(ANDROID) && !defined(__OpenBSD__)
|
||||
static locale_t GetCLocale()
|
||||
{
|
||||
static locale_t c_locale = newlocale(LC_ALL_MASK, "C", nullptr);
|
||||
@ -121,11 +121,11 @@ bool CharArrayFromFormatV(char* out, int outsize, const char* format, va_list ar
|
||||
c_locale = _create_locale(LC_ALL, "C");
|
||||
writtenCount = _vsnprintf_l(out, outsize, format, c_locale, args);
|
||||
#else
|
||||
#if !defined(ANDROID)
|
||||
#if !defined(ANDROID) && !defined(__OpenBSD__)
|
||||
locale_t previousLocale = uselocale(GetCLocale());
|
||||
#endif
|
||||
writtenCount = vsnprintf(out, outsize, format, args);
|
||||
#if !defined(ANDROID)
|
||||
#if !defined(ANDROID) && !defined(__OpenBSD__)
|
||||
uselocale(previousLocale);
|
||||
#endif
|
||||
#endif
|
||||
@ -162,12 +162,12 @@ std::string StringFromFormatV(const char* format, va_list args)
|
||||
std::string temp = buf;
|
||||
delete[] buf;
|
||||
#else
|
||||
#if !defined(ANDROID)
|
||||
#if !defined(ANDROID) && !defined(__OpenBSD__)
|
||||
locale_t previousLocale = uselocale(GetCLocale());
|
||||
#endif
|
||||
if (vasprintf(&buf, format, args) < 0)
|
||||
ERROR_LOG(COMMON, "Unable to allocate memory for string");
|
||||
#if !defined(ANDROID)
|
||||
#if !defined(ANDROID) && !defined(__OpenBSD__)
|
||||
uselocale(previousLocale);
|
||||
#endif
|
||||
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
#ifdef __APPLE__
|
||||
#include <mach/mach.h>
|
||||
#elif defined BSD4_4 || defined __FreeBSD__
|
||||
#elif defined BSD4_4 || defined __FreeBSD__ || defined __OpenBSD__
|
||||
#include <pthread_np.h>
|
||||
#endif
|
||||
|
||||
@ -132,7 +132,7 @@ void SetCurrentThreadName(const char* szThreadName)
|
||||
{
|
||||
#ifdef __APPLE__
|
||||
pthread_setname_np(szThreadName);
|
||||
#elif defined __FreeBSD__
|
||||
#elif defined __FreeBSD__ || defined __OpenBSD__
|
||||
pthread_set_name_np(pthread_self(), szThreadName);
|
||||
#else
|
||||
// linux doesn't allow to set more than 16 bytes, including \0.
|
||||
|
Reference in New Issue
Block a user