public: add XASH_POSIX platform define

This commit is contained in:
mittorn 2020-02-08 22:52:36 +07:00
parent 22c148a39e
commit adc718f4d5
2 changed files with 8 additions and 7 deletions

View File

@ -22,7 +22,7 @@ GNU General Public License for more details.
#include <SDL.h> #include <SDL.h>
#endif #endif
#if !XASH_WIN32 #if XASH_POSIX
#include <unistd.h> #include <unistd.h>
#include <signal.h> #include <signal.h>
#include <dlfcn.h> #include <dlfcn.h>
@ -46,7 +46,6 @@ double GAME_EXPORT Sys_DoubleTime( void )
{ {
return Platform_DoubleTime(); return Platform_DoubleTime();
} }
#if XASH_LINUX || ( XASH_WIN32 && !XASH_64BIT ) #if XASH_LINUX || ( XASH_WIN32 && !XASH_64BIT )
#undef DEBUG_BREAK #undef DEBUG_BREAK
qboolean Sys_DebuggerPresent( void ); // see sys_linux.c qboolean Sys_DebuggerPresent( void ); // see sys_linux.c
@ -64,7 +63,6 @@ double GAME_EXPORT Sys_DoubleTime( void )
raise( SIGINT ) raise( SIGINT )
#endif #endif
#endif #endif
#if !XASH_DEDICATED #if !XASH_DEDICATED
/* /*
================ ================
@ -128,7 +126,7 @@ char *Sys_GetCurrentUser( void )
if( GetUserName( s_userName, &size )) if( GetUserName( s_userName, &size ))
return s_userName; return s_userName;
#elif !XASH_ANDROID #elif XASH_POSIX && !XASH_ANDROID
uid_t uid = geteuid(); uid_t uid = geteuid();
struct passwd *pw = getpwuid( uid ); struct passwd *pw = getpwuid( uid );

View File

@ -38,7 +38,7 @@ GNU General Public License for more details.
#undef XASH_ARMv5 #undef XASH_ARMv5
#undef XASH_ARMv6 #undef XASH_ARMv6
#undef XASH_ARMv7 #undef XASH_ARMv7
#undef XASH_BIG_ENDIAN //#undef XASH_BIG_ENDIAN
#undef XASH_BSD #undef XASH_BSD
#undef XASH_E2K #undef XASH_E2K
#undef XASH_EMSCRIPTEN #undef XASH_EMSCRIPTEN
@ -46,7 +46,7 @@ GNU General Public License for more details.
#undef XASH_IOS #undef XASH_IOS
#undef XASH_JS #undef XASH_JS
#undef XASH_LINUX #undef XASH_LINUX
#undef XASH_LITTLE_ENDIAN //#undef XASH_LITTLE_ENDIAN
#undef XASH_MINGW #undef XASH_MINGW
#undef XASH_MIPS #undef XASH_MIPS
#undef XASH_MOBILE_PLATFORM #undef XASH_MOBILE_PLATFORM
@ -78,12 +78,14 @@ GNU General Public License for more details.
#if defined(__ANDROID__) #if defined(__ANDROID__)
#define XASH_ANDROID 1 #define XASH_ANDROID 1
#endif // defined(__ANDROID__) #endif // defined(__ANDROID__)
#define XASH_POSIX 1
#elif defined(__APPLE__) #elif defined(__APPLE__)
#include <TargetConditionals.h> #include <TargetConditionals.h>
#define XASH_APPLE 1 #define XASH_APPLE 1
#if TARGET_OS_IOS #if TARGET_OS_IOS
#define XASH_IOS 1 #define XASH_IOS 1
#endif // TARGET_OS_IOS #endif // TARGET_OS_IOS
#define XASH_POSIX 1
#elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) #elif defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__)
#define XASH_BSD 1 #define XASH_BSD 1
#if defined(__FreeBSD__) #if defined(__FreeBSD__)
@ -93,6 +95,7 @@ GNU General Public License for more details.
#elif defined(__OpenBSD__) #elif defined(__OpenBSD__)
#define XASH_OPENBSD 1 #define XASH_OPENBSD 1
#endif #endif
#define XASH_POSIX 1
#elif defined __EMSCRIPTEN__ #elif defined __EMSCRIPTEN__
#define XASH_EMSCRIPTEN 1 #define XASH_EMSCRIPTEN 1
#else #else
@ -113,7 +116,7 @@ GNU General Public License for more details.
#error "Both XASH_LITTLE_ENDIAN and XASH_BIG_ENDIAN are defined" #error "Both XASH_LITTLE_ENDIAN and XASH_BIG_ENDIAN are defined"
#endif #endif
#if !defined(XASH_LITTLE_ENDIAN) || !defined(XASH_BIG_ENDIAN) #if !defined(XASH_LITTLE_ENDIAN) && !defined(XASH_BIG_ENDIAN)
#if defined XASH_MSVC || __LITTLE_ENDIAN__ #if defined XASH_MSVC || __LITTLE_ENDIAN__
//!!! Probably all WinNT installations runs in little endian //!!! Probably all WinNT installations runs in little endian
#define XASH_LITTLE_ENDIAN 1 #define XASH_LITTLE_ENDIAN 1