mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-18 04:53:06 +01:00
Cleanup.
This commit is contained in:
@@ -11,17 +11,22 @@
|
||||
|
||||
#if BX_PLATFORM_WINDOWS || BX_PLATFORM_WINRT
|
||||
# include <windows.h>
|
||||
#elif BX_PLATFORM_ANDROID \
|
||||
#elif BX_PLATFORM_ANDROID \
|
||||
|| BX_PLATFORM_EMSCRIPTEN \
|
||||
|| BX_PLATFORM_FREEBSD \
|
||||
|| BX_PLATFORM_IOS \
|
||||
|| BX_PLATFORM_LINUX \
|
||||
|| BX_PLATFORM_NACL \
|
||||
|| BX_PLATFORM_OSX \
|
||||
|| BX_PLATFORM_PS4 \
|
||||
|| BX_PLATFORM_RPI
|
||||
|
||||
# include <sched.h> // sched_yield
|
||||
# if BX_PLATFORM_FREEBSD || BX_PLATFORM_IOS || BX_PLATFORM_NACL || BX_PLATFORM_OSX
|
||||
# if BX_PLATFORM_FREEBSD \
|
||||
|| BX_PLATFORM_IOS \
|
||||
|| BX_PLATFORM_NACL \
|
||||
|| BX_PLATFORM_OSX \
|
||||
|| BX_PLATFORM_PS4
|
||||
# include <pthread.h> // mach_port_t
|
||||
# endif // BX_PLATFORM_IOS || BX_PLATFORM_OSX || BX_PLATFORM_NACL
|
||||
|
||||
@@ -29,7 +34,9 @@
|
||||
# include <sys/nacl_syscalls.h> // nanosleep
|
||||
# else
|
||||
# include <time.h> // nanosleep
|
||||
# include <dlfcn.h> // dlopen, dlclose, dlsym
|
||||
# if !BX_PLATFORM_PS4
|
||||
# include <dlfcn.h> // dlopen, dlclose, dlsym
|
||||
# endif // !BX_PLATFORM_PS4
|
||||
# endif // BX_PLATFORM_NACL
|
||||
|
||||
# if BX_PLATFORM_LINUX || BX_PLATFORM_RPI
|
||||
@@ -107,7 +114,10 @@ namespace bx
|
||||
{
|
||||
#if BX_PLATFORM_WINDOWS
|
||||
return (void*)::LoadLibraryA(_filePath);
|
||||
#elif BX_PLATFORM_NACL || BX_PLATFORM_EMSCRIPTEN || BX_PLATFORM_WINRT
|
||||
#elif BX_PLATFORM_EMSCRIPTEN \
|
||||
|| BX_PLATFORM_NACL \
|
||||
|| BX_PLATFORM_PS4 \
|
||||
|| BX_PLATFORM_WINRT
|
||||
BX_UNUSED(_filePath);
|
||||
return NULL;
|
||||
#else
|
||||
@@ -119,7 +129,10 @@ namespace bx
|
||||
{
|
||||
#if BX_PLATFORM_WINDOWS
|
||||
::FreeLibrary( (HMODULE)_handle);
|
||||
#elif BX_PLATFORM_NACL || BX_PLATFORM_EMSCRIPTEN || BX_PLATFORM_WINRT
|
||||
#elif BX_PLATFORM_EMSCRIPTEN \
|
||||
|| BX_PLATFORM_NACL \
|
||||
|| BX_PLATFORM_PS4 \
|
||||
|| BX_PLATFORM_WINRT
|
||||
BX_UNUSED(_handle);
|
||||
#else
|
||||
::dlclose(_handle);
|
||||
@@ -130,7 +143,10 @@ namespace bx
|
||||
{
|
||||
#if BX_PLATFORM_WINDOWS
|
||||
return (void*)::GetProcAddress( (HMODULE)_handle, _symbol);
|
||||
#elif BX_PLATFORM_NACL || BX_PLATFORM_EMSCRIPTEN || BX_PLATFORM_WINRT
|
||||
#elif BX_PLATFORM_EMSCRIPTEN \
|
||||
|| BX_PLATFORM_NACL \
|
||||
|| BX_PLATFORM_PS4 \
|
||||
|| BX_PLATFORM_WINRT
|
||||
BX_UNUSED(_handle, _symbol);
|
||||
return NULL;
|
||||
#else
|
||||
@@ -142,7 +158,8 @@ namespace bx
|
||||
{
|
||||
#if BX_PLATFORM_WINDOWS
|
||||
::SetEnvironmentVariableA(_name, _value);
|
||||
#elif BX_PLATFORM_WINRT
|
||||
#elif BX_PLATFORM_PS4 \
|
||||
|| BX_PLATFORM_WINRT
|
||||
BX_UNUSED(_name, _value);
|
||||
#else
|
||||
::setenv(_name, _value, 1);
|
||||
@@ -153,7 +170,8 @@ namespace bx
|
||||
{
|
||||
#if BX_PLATFORM_WINDOWS
|
||||
::SetEnvironmentVariableA(_name, NULL);
|
||||
#elif BX_PLATFORM_WINRT
|
||||
#elif BX_PLATFORM_PS4 \
|
||||
|| BX_PLATFORM_WINRT
|
||||
BX_UNUSED(_name);
|
||||
#else
|
||||
::unsetenv(_name);
|
||||
@@ -162,7 +180,8 @@ namespace bx
|
||||
|
||||
inline int chdir(const char* _path)
|
||||
{
|
||||
#if BX_PLATFORM_WINRT
|
||||
#if BX_PLATFORM_PS4 \
|
||||
|| BX_PLATFORM_WINRT
|
||||
BX_UNUSED(_path);
|
||||
return -1;
|
||||
#elif BX_COMPILER_MSVC_COMPATIBLE
|
||||
@@ -174,7 +193,8 @@ namespace bx
|
||||
|
||||
inline char* pwd(char* _buffer, uint32_t _size)
|
||||
{
|
||||
#if BX_PLATFORM_WINRT
|
||||
#if BX_PLATFORM_PS4 \
|
||||
|| BX_PLATFORM_WINRT
|
||||
BX_UNUSED(_buffer, _size);
|
||||
return NULL;
|
||||
#elif BX_COMPILER_MSVC_COMPATIBLE
|
||||
|
||||
@@ -200,6 +200,7 @@
|
||||
|| BX_PLATFORM_NACL \
|
||||
|| BX_PLATFORM_OSX \
|
||||
|| BX_PLATFORM_QNX \
|
||||
|| BX_PLATFORM_PS4 \
|
||||
|| BX_PLATFORM_RPI \
|
||||
)
|
||||
|
||||
|
||||
1
include/compat/freebsd/signal.h
Normal file
1
include/compat/freebsd/signal.h
Normal file
@@ -0,0 +1 @@
|
||||
#include <sys/signal.h>
|
||||
Reference in New Issue
Block a user