mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-18 04:53:06 +01:00
feat: add visionOS support (#323)
* feat: define BX_PLATFORM_VISIONOS * chore: add xros, xrsimulator toolchain support
This commit is contained in:
committed by
GitHub
parent
0b8bb71897
commit
f8dc7147b6
@@ -16,7 +16,7 @@
|
||||
|| BX_PLATFORM_WINRT \
|
||||
|| BX_PLATFORM_XBOXONE
|
||||
extern "C" __declspec(dllimport) void __stdcall OutputDebugStringA(const char* _str);
|
||||
#elif BX_PLATFORM_IOS || BX_PLATFORM_OSX
|
||||
#elif BX_PLATFORM_IOS || BX_PLATFORM_OSX || BX_PLATFORM_VISIONOS
|
||||
# if defined(__OBJC__)
|
||||
# import <Foundation/NSObjCRuntime.h>
|
||||
# else
|
||||
@@ -73,7 +73,8 @@ namespace bx
|
||||
|| BX_PLATFORM_XBOXONE
|
||||
OutputDebugStringA(_out);
|
||||
#elif BX_PLATFORM_IOS \
|
||||
|| BX_PLATFORM_OSX
|
||||
|| BX_PLATFORM_OSX \
|
||||
|| BX_PLATFORM_VISIONOS
|
||||
# if defined(__OBJC__)
|
||||
NSLog(@"%s", _out);
|
||||
# else
|
||||
|
||||
@@ -74,7 +74,8 @@ namespace bx
|
||||
|| BX_PLATFORM_ANDROID \
|
||||
|| BX_PLATFORM_EMSCRIPTEN \
|
||||
|| BX_PLATFORM_IOS \
|
||||
|| BX_PLATFORM_OSX
|
||||
|| BX_PLATFORM_OSX \
|
||||
|| BX_PLATFORM_VISIONOS
|
||||
# define fseeko64 fseeko
|
||||
# define ftello64 ftello
|
||||
# elif BX_PLATFORM_PS4
|
||||
|
||||
@@ -16,7 +16,8 @@
|
||||
|| BX_PLATFORM_OSX \
|
||||
|| BX_PLATFORM_PS4 \
|
||||
|| BX_PLATFORM_RPI \
|
||||
|| BX_PLATFORM_NX
|
||||
|| BX_PLATFORM_NX \
|
||||
|| BX_PLATFORM_VISIONOS
|
||||
# include <pthread.h>
|
||||
#elif BX_PLATFORM_WINDOWS \
|
||||
|| BX_PLATFORM_WINRT \
|
||||
|
||||
@@ -26,11 +26,13 @@
|
||||
|| BX_PLATFORM_NX \
|
||||
|| BX_PLATFORM_OSX \
|
||||
|| BX_PLATFORM_PS4 \
|
||||
|| BX_PLATFORM_RPI
|
||||
|| BX_PLATFORM_RPI \
|
||||
|| BX_PLATFORM_VISIONOS
|
||||
# include <sched.h> // sched_yield
|
||||
# if BX_PLATFORM_IOS \
|
||||
|| BX_PLATFORM_OSX \
|
||||
|| BX_PLATFORM_PS4
|
||||
|| BX_PLATFORM_PS4 \
|
||||
|| BX_PLATFORM_VISIONOS
|
||||
# include <pthread.h> // mach_port_t
|
||||
# endif // BX_PLATFORM_*
|
||||
|
||||
|
||||
@@ -9,7 +9,8 @@
|
||||
|
||||
#if BX_CRT_NONE
|
||||
#elif BX_PLATFORM_OSX \
|
||||
|| BX_PLATFORM_IOS
|
||||
|| BX_PLATFORM_IOS \
|
||||
|| BX_PLATFORM_VISIONOS
|
||||
# include <dispatch/dispatch.h>
|
||||
#elif BX_PLATFORM_POSIX
|
||||
# include <errno.h>
|
||||
@@ -36,7 +37,8 @@ namespace bx
|
||||
#if BX_CRT_NONE
|
||||
|
||||
#elif BX_PLATFORM_OSX \
|
||||
|| BX_PLATFORM_IOS
|
||||
|| BX_PLATFORM_IOS \
|
||||
|| BX_PLATFORM_VISIONOS
|
||||
dispatch_semaphore_t m_handle;
|
||||
#elif BX_PLATFORM_POSIX
|
||||
pthread_mutex_t m_mutex;
|
||||
@@ -70,7 +72,8 @@ namespace bx
|
||||
return false;
|
||||
}
|
||||
#elif BX_PLATFORM_OSX \
|
||||
|| BX_PLATFORM_IOS
|
||||
|| BX_PLATFORM_IOS \
|
||||
|| BX_PLATFORM_VISIONOS
|
||||
|
||||
Semaphore::Semaphore()
|
||||
{
|
||||
|
||||
@@ -20,7 +20,8 @@
|
||||
|| BX_PLATFORM_OSX \
|
||||
|| BX_PLATFORM_PS4 \
|
||||
|| BX_PLATFORM_RPI \
|
||||
|| BX_PLATFORM_NX
|
||||
|| BX_PLATFORM_NX \
|
||||
|| BX_PLATFORM_VISIONOS
|
||||
# include <pthread.h>
|
||||
# if BX_PLATFORM_LINUX && (BX_CRT_GLIBC < 21200)
|
||||
# include <sys/prctl.h>
|
||||
@@ -243,7 +244,8 @@ namespace bx
|
||||
#if BX_CRT_NONE
|
||||
BX_UNUSED(_name);
|
||||
#elif BX_PLATFORM_OSX \
|
||||
|| BX_PLATFORM_IOS
|
||||
|| BX_PLATFORM_IOS \
|
||||
|| BX_PLATFORM_VISIONOS
|
||||
pthread_setname_np(_name);
|
||||
#elif (BX_CRT_GLIBC >= 21200)
|
||||
pthread_setname_np(ti->m_handle, _name);
|
||||
|
||||
Reference in New Issue
Block a user