mirror of
https://github.com/bkaradzic/bx.git
synced 2026-02-17 20:52:37 +01:00
Cleanup.
This commit is contained in:
@@ -12,11 +12,7 @@
|
||||
#include <new>
|
||||
|
||||
#if BX_CONFIG_ALLOCATOR_CRT
|
||||
# if BX_PLATFORM_FREEBSD
|
||||
# include <stdlib.h>
|
||||
# else
|
||||
# include <malloc.h>
|
||||
# endif
|
||||
# include <malloc.h>
|
||||
#endif // BX_CONFIG_ALLOCATOR_CRT
|
||||
|
||||
#if BX_CONFIG_ALLOCATOR_DEBUG
|
||||
|
||||
@@ -157,12 +157,12 @@
|
||||
#ifndef BX_CONFIG_CRT_FILE_READER_WRITER
|
||||
# define BX_CONFIG_CRT_FILE_READER_WRITER (0 \
|
||||
|BX_PLATFORM_ANDROID \
|
||||
|BX_PLATFORM_FREEBSD \
|
||||
|BX_PLATFORM_IOS \
|
||||
|BX_PLATFORM_LINUX \
|
||||
|BX_PLATFORM_OSX \
|
||||
|BX_PLATFORM_QNX \
|
||||
|BX_PLATFORM_WINDOWS \
|
||||
|BX_PLATFORM_FREEBSD \
|
||||
)
|
||||
#endif // BX_CONFIG_CRT_FILE_READER_WRITER
|
||||
|
||||
|
||||
@@ -10,16 +10,16 @@
|
||||
|
||||
#if BX_PLATFORM_WINDOWS
|
||||
# include <windows.h>
|
||||
#elif BX_PLATFORM_NACL \
|
||||
|| BX_PLATFORM_ANDROID \
|
||||
|| BX_PLATFORM_LINUX \
|
||||
|| BX_PLATFORM_OSX \
|
||||
|| BX_PLATFORM_IOS \
|
||||
#elif BX_PLATFORM_ANDROID \
|
||||
|| BX_PLATFORM_EMSCRIPTEN \
|
||||
|| BX_PLATFORM_FREEBSD
|
||||
|| BX_PLATFORM_FREEBSD \
|
||||
|| BX_PLATFORM_IOS \
|
||||
|| BX_PLATFORM_LINUX \
|
||||
|| BX_PLATFORM_NACL \
|
||||
|| BX_PLATFORM_OSX
|
||||
|
||||
# include <sched.h> // sched_yield
|
||||
# if BX_PLATFORM_IOS || BX_PLATFORM_OSX || BX_PLATFORM_NACL || BX_PLATFORM_FREEBSD
|
||||
# if BX_PLATFORM_FREEBSD || BX_PLATFORM_IOS || BX_PLATFORM_NACL || BX_PLATFORM_OSX
|
||||
# include <pthread.h> // mach_port_t
|
||||
# endif // BX_PLATFORM_IOS || BX_PLATFORM_OSX || BX_PLATFORM_NACL
|
||||
|
||||
@@ -78,7 +78,7 @@ namespace bx
|
||||
return (pid_t)::syscall(SYS_gettid);
|
||||
#elif BX_PLATFORM_IOS || BX_PLATFORM_OSX
|
||||
return (mach_port_t)::pthread_mach_thread_np(pthread_self() );
|
||||
#elif BX_PLATFORM_NACL || BX_PLATFORM_FREEBSD
|
||||
#elif BX_PLATFORM_FREEBSD || BX_PLATFORM_NACL
|
||||
// Casting __nc_basic_thread_data*... need better way to do this.
|
||||
return *(uint32_t*)::pthread_self();
|
||||
#else
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
|
||||
#define BX_PLATFORM_ANDROID 0
|
||||
#define BX_PLATFORM_EMSCRIPTEN 0
|
||||
#define BX_PLATFORM_FREEBSD 0
|
||||
#define BX_PLATFORM_IOS 0
|
||||
#define BX_PLATFORM_LINUX 0
|
||||
#define BX_PLATFORM_NACL 0
|
||||
@@ -19,7 +20,6 @@
|
||||
#define BX_PLATFORM_QNX 0
|
||||
#define BX_PLATFORM_WINDOWS 0
|
||||
#define BX_PLATFORM_XBOX360 0
|
||||
#define BX_PLATFORM_FREEBSD 0
|
||||
|
||||
#define BX_CPU_ARM 0
|
||||
#define BX_CPU_JIT 0
|
||||
@@ -91,14 +91,16 @@
|
||||
# error "BX_PLATFORM_* is not defined!"
|
||||
#endif //
|
||||
|
||||
#define BX_PLATFORM_POSIX (BX_PLATFORM_ANDROID \
|
||||
#define BX_PLATFORM_POSIX (0 \
|
||||
|| BX_PLATFORM_ANDROID \
|
||||
|| BX_PLATFORM_EMSCRIPTEN \
|
||||
|| BX_PLATFORM_FREEBSD \
|
||||
|| BX_PLATFORM_IOS \
|
||||
|| BX_PLATFORM_LINUX \
|
||||
|| BX_PLATFORM_NACL \
|
||||
|| BX_PLATFORM_OSX \
|
||||
|| BX_PLATFORM_QNX \
|
||||
|| BX_PLATFORM_FREEBSD )
|
||||
)
|
||||
|
||||
// http://sourceforge.net/apps/mediawiki/predef/index.php?title=Architectures
|
||||
#if defined(__arm__)
|
||||
@@ -155,6 +157,8 @@
|
||||
# define BX_PLATFORM_NAME "Android"
|
||||
#elif BX_PLATFORM_EMSCRIPTEN
|
||||
# define BX_PLATFORM_NAME "asm.js"
|
||||
#elif BX_PLATFORM_FREEBSD
|
||||
# define BX_PLATFORM_NAME "FreeBSD"
|
||||
#elif BX_PLATFORM_IOS
|
||||
# define BX_PLATFORM_NAME "iOS"
|
||||
#elif BX_PLATFORM_LINUX
|
||||
@@ -165,8 +169,6 @@
|
||||
# define BX_PLATFORM_NAME "OSX"
|
||||
#elif BX_PLATFORM_QNX
|
||||
# define BX_PLATFORM_NAME "QNX"
|
||||
#elif BX_PLATFORM_FREEBSD
|
||||
# define BX_PLATFORM_NAME "FreeBSD"
|
||||
#elif BX_PLATFORM_WINDOWS
|
||||
# define BX_PLATFORM_NAME "Windows"
|
||||
#endif // BX_PLATFORM_
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
#if BX_COMPILER_MSVC
|
||||
# define fseeko64 _fseeki64
|
||||
# define ftello64 _ftelli64
|
||||
#elif BX_PLATFORM_ANDROID|BX_PLATFORM_IOS|BX_PLATFORM_OSX|BX_PLATFORM_QNX|BX_PLATFORM_FREEBSD
|
||||
#elif BX_PLATFORM_ANDROID || BX_PLATFORM_FREEBSD || BX_PLATFORM_IOS || BX_PLATFORM_OSX || BX_PLATFORM_QNX
|
||||
# define fseeko64 fseeko
|
||||
# define ftello64 ftello
|
||||
#endif // BX_
|
||||
|
||||
@@ -7,9 +7,7 @@
|
||||
#define BX_PRINTF_H_HEADER_GUARD
|
||||
|
||||
#include "bx.h"
|
||||
#if !BX_PLATFORM_FREEBSD
|
||||
# include <alloca.h>
|
||||
#endif
|
||||
#include <alloca.h>
|
||||
#include <ctype.h> // tolower
|
||||
#include <stdarg.h> // va_list
|
||||
#include <stdio.h> // vsnprintf, vsnwprintf
|
||||
|
||||
@@ -12,7 +12,7 @@
|
||||
# include <time.h> // clock, clock_gettime
|
||||
#elif BX_PLATFORM_EMSCRIPTEN
|
||||
# include <emscripten.h>
|
||||
#elif BX_PLATFORM_NACL || BX_PLATFORM_LINUX || BX_PLATFORM_OSX || BX_PLATFORM_IOS || BX_PLATFORM_QNX || BX_PLATFORM_FREEBSD
|
||||
#elif BX_PLATFORM_FREEBSD || BX_PLATFORM_LINUX || BX_PLATFORM_NACL || BX_PLATFORM_OSX || BX_PLATFORM_IOS || BX_PLATFORM_QNX
|
||||
# include <sys/time.h> // gettimeofday
|
||||
#elif BX_PLATFORM_WINDOWS
|
||||
# include <windows.h>
|
||||
|
||||
1
include/compat/freebsd/alloca.h
Normal file
1
include/compat/freebsd/alloca.h
Normal file
@@ -0,0 +1 @@
|
||||
#include <stdlib.h>
|
||||
1
include/compat/freebsd/malloc.h
Normal file
1
include/compat/freebsd/malloc.h
Normal file
@@ -0,0 +1 @@
|
||||
#include <stdlib.h>
|
||||
Reference in New Issue
Block a user