[Build] Generalize POSIX platform guards

Most non-Windows code paths use standard POSIX APIs (sockets, signals,
dlopen, threading) that work on any POSIX platform. Change Linux-specific
guards to !WIN32 or #else where the code is portable. Linux-specific
APIs (SIGRTMIN, Vulkan/X11, fontconfig/GTK) remain Linux-guarded.
This commit is contained in:
Herman S.
2026-03-26 22:07:28 +09:00
parent 6c20f64e0d
commit cb12f7fa1e
10 changed files with 39 additions and 48 deletions

View File

@@ -74,7 +74,7 @@ inline void atomic_store_release(uint32_t new_value, volatile uint32_t* value) {
_InterlockedExchange(reinterpret_cast<volatile long*>(value), new_value);
}
#elif XE_PLATFORM_LINUX || XE_PLATFORM_MAC
#else
inline int32_t atomic_inc(volatile int32_t* value) {
return __sync_add_and_fetch(value, 1);
@@ -133,10 +133,6 @@ inline bool atomic_cas(int64_t old_value, int64_t new_value,
reinterpret_cast<volatile int64_t*>(value), old_value, new_value);
}
#else
#error No atomic primitives defined for this platform/cpu combination.
#endif // XE_PLATFORM
inline uint32_t atomic_inc(volatile uint32_t* value) {

View File

@@ -15,7 +15,7 @@
#include "platform.h"
#if XE_PLATFORM_WIN32
#include "platform_win.h"
#elif XE_PLATFORM_LINUX
#else
#include <sys/types.h>
#endif
#include "memory.h"