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
+1 -1
View File
@@ -61,7 +61,7 @@ void AppShutdown( CAppSystemGroup *pAppSystemGroup );
extern int ValveCocoaMain( int argc, char **argv, CAppSystemGroup *pAppSystemGroup ); \
return ValveCocoaMain( argc, argv, &_globalVarName ); \
}
#elif defined( LINUX ) || defined(BSD)
#elif defined( LINUX ) || defined(PLATFORM_BSD)
#define DEFINE_WINDOWED_APPLICATION_OBJECT_GLOBALVAR( _globalVarName ) \
int main( int argc, char **argv ) \
{ \
+1 -1
View File
@@ -52,7 +52,7 @@ public:
// Get the next N events. The function returns the number of events that were filled into your array.
virtual int GetEvents( CCocoaEvent *pEvents, int nMaxEventsToReturn, bool debugEvents = false ) = 0;
#if defined(LINUX) || defined(BSD)
#if defined(LINUX) || defined(PLATFORM_BSD)
virtual int PeekAndRemoveKeyboardEvents( bool *pbEsc, bool *pbReturn, bool *pbSpace, bool debugEvents = false ) = 0;
#endif
+1 -1
View File
@@ -36,7 +36,7 @@
* because this file defines png_memcpy and so on the base APIs must
* be defined here.
*/
# ifdef BSD
# ifdef PLATFORM_BSD
# include <strings.h>
# else
# include <string.h>
+5 -5
View File
@@ -64,7 +64,7 @@
#ifdef POSIX
// need this for _alloca
# ifdef BSD
# ifdef PLATFORM_BSD
# define va_list __va_list
# else
# include <alloca.h>
@@ -162,7 +162,7 @@
#define IsOSX() false
#endif
#ifdef BSD
#ifdef PLATFORM_BSD
#define IsBSD() true
#else
#define IsBSD() false
@@ -450,7 +450,7 @@ typedef void * HINSTANCE;
#else
// On OSX, SIGTRAP doesn't really stop the thread cold when debugging.
// So if being debugged, use INT3 which is precise.
#if defined(OSX) || defined(BSD)
#if defined(OSX) || defined(PLATFORM_BSD)
# if defined(__arm__) || defined(__aarch64__)
# ifdef __clang__
# define DebuggerBreak() do { if ( Plat_IsInDebugSession() ) { __builtin_debugtrap(); } else { raise(SIGTRAP); } } while(0)
@@ -561,7 +561,7 @@ typedef void * HINSTANCE;
//-----------------------------------------------------------------------------
#if defined( GNUC )
#define stackalloc( _size ) alloca( ALIGN_VALUE( _size, 16 ) )
#if defined(_LINUX) || defined(BSD)
#if defined(_LINUX) || defined(PLATFORM_BSD)
#define mallocsize( _p ) ( malloc_usable_size( _p ) )
#elif defined(OSX)
#define mallocsize( _p ) ( malloc_size( _p ) )
@@ -1388,7 +1388,7 @@ PLATFORM_INTERFACE void* Plat_SimpleLog( const tchar* file, int line );
//-----------------------------------------------------------------------------
// Returns true if debugger attached, false otherwise
//-----------------------------------------------------------------------------
#if defined(_WIN32) || defined(LINUX) || defined(OSX) || defined(BSD)
#if defined(_WIN32) || defined(LINUX) || defined(OSX) || defined(PLATFORM_BSD)
PLATFORM_INTERFACE bool Plat_IsInDebugSession();
PLATFORM_INTERFACE void Plat_DebugString( const char * );
#else
+2 -2
View File
@@ -285,7 +285,7 @@ PLATFORM_INTERFACE void ThreadSetAffinity( ThreadHandle_t hThread, int nAffinity
#error Every platform needs to define ThreadMemoryBarrier to at least prevent compiler reordering
#endif
#if defined( _LINUX ) || defined( _OSX ) || defined(BSD)
#if defined( _LINUX ) || defined( _OSX ) || defined(PLATFORM_BSD)
#define USE_INTRINSIC_INTERLOCKED
// linux implementation
inline int32 ThreadInterlockedIncrement( int32 volatile *p )
@@ -486,7 +486,7 @@ PLATFORM_INTERFACE void ThreadNotifySyncReleasing(void *p);
#ifndef NO_THREAD_LOCAL
#if defined(WIN32) || defined(OSX) || defined( _PS3 ) || ( defined (_LINUX) ) || defined(BSD)
#if defined(WIN32) || defined(OSX) || defined( _PS3 ) || ( defined (_LINUX) ) || defined(PLATFORM_BSD)
#ifndef __AFXTLS_H__ // not compatible with some Windows headers
#if defined(_PS3)
+1 -1
View File
@@ -36,7 +36,7 @@
#pragma once
#endif
#if defined(_LINUX) || defined(BSD)
#if defined(_LINUX) || defined(PLATFORM_BSD)
#include <dlfcn.h> // dlopen,dlclose, et al
#include <unistd.h>