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

@@ -15,7 +15,8 @@
#include <Psapi.h>
#endif
#if defined( OSX ) || defined(BSD)
#if defined( OSX ) || defined(PLATFORM_BSD)
#include <sys/types.h>
#include <sys/sysctl.h>
#endif
@@ -278,7 +279,7 @@ static void posix_signal_handler( int i )
#define DO_TRY if ( sigsetjmp( g_mark, 1 ) == 0 )
#define DO_CATCH else
#if defined( OSX ) || defined(BSD)
#if defined( OSX ) || defined(PLATFORM_BSD)
#define __sighandler_t sig_t
#endif
@@ -537,7 +538,7 @@ public:
FreeLibrary( hInst );
}
#elif defined( OSX ) || defined(BSD)
#elif defined( OSX ) || defined(PLATFORM_BSD)
static const struct
{
@@ -548,7 +549,7 @@ public:
#define _XTAG( _x ) { _x, #_x }
_XTAG( HW_PHYSMEM ),
_XTAG( HW_USERMEM ),
#ifdef BSD
#ifdef PLATFORM_BSD
_XTAG( HW_PHYSMEM ),
_XTAG( HW_NCPU ),
#else
@@ -566,7 +567,7 @@ public:
if ( sysctl( mib, Q_ARRAYSIZE( mib ), &val, &len, NULL, 0 ) == 0 )
{
CommentPrintf( " %s: %" PRIu64 "\n", s_ctl_names[ i ].name, val );
CommentPrintf( " %s: %d\n", s_ctl_names[ i ].name, val );
}
}