Fix macOS build (#146)

* Fix macOS build
* Fix *BSD build
* Add missing *BSD include
This commit is contained in:
exstrim401
2022-11-27 16:48:27 +03:00
committed by GitHub
parent 53bd92f7a8
commit 2fb712af66
45 changed files with 107 additions and 98 deletions

View File

@@ -28,7 +28,7 @@
#include "vgui_key_translation.h"
#include "filesystem.h"
#if defined(OSX) || defined(BSD)
#if defined(OSX) || defined(PLATFORM_BSD)
#include <sys/param.h>
#include <sys/mount.h>
#elif defined(LINUX)
@@ -292,7 +292,7 @@ void CSystem::ShellExecute(const char *command, const char *file)
if ( pid == 0 )
{
// Child
#if defined(LINUX) || defined(BSD)
#if defined(LINUX) || defined(PLATFORM_BSD)
// Escape steam runtime if necessary
const char *szSteamRuntime = getenv( "STEAM_RUNTIME" );
if ( szSteamRuntime )
@@ -587,7 +587,7 @@ int CSystem::GetAvailableDrives(char *buf, int bufLen)
//-----------------------------------------------------------------------------
double CSystem::GetFreeDiskSpace(const char *path)
{
#if __DARWIN_ONLY_64_BIT_INO_T || BSD
#if __DARWIN_ONLY_64_BIT_INO_T || PLATFORM_BSD
// MoeMod: newer macOS only support 64bit, so no statfs64 is provided
struct statfs buf;
int ret = statfs( path, &buf );

View File

@@ -584,7 +584,7 @@ FallbackFont_t g_FallbackFonts[] =
{ NULL, "Monaco" } // every other font falls back to this
};
#elif defined(LINUX) || defined(BSD)
#elif defined(LINUX) || defined(PLATFORM_BSD)
static const char *g_szValidAsianFonts[] = { "Marlett", "WenQuanYi Zen Hei", "unifont", NULL };
// list of how fonts fallback
@@ -649,7 +649,7 @@ const char *CFontManager::GetForeignFallbackFontName()
return "Tahoma";
#elif defined(OSX)
return "Helvetica";
#elif defined(LINUX) || defined(BSD)
#elif defined(LINUX) || defined(PLATFORM_BSD)
return "WenQuanYi Zen Hei";
#elif defined(_PS3)
return "Tahoma";