mirror of
https://github.com/holub/mame
synced 2025-10-04 16:34:53 +03:00
bx: sync with upstream
This commit is contained in:
parent
6256946dee
commit
ef8816ae18
60
3rdparty/bx/include/bx/platform.h
vendored
60
3rdparty/bx/include/bx/platform.h
vendored
@ -6,12 +6,37 @@
|
|||||||
#ifndef BX_PLATFORM_H_HEADER_GUARD
|
#ifndef BX_PLATFORM_H_HEADER_GUARD
|
||||||
#define BX_PLATFORM_H_HEADER_GUARD
|
#define BX_PLATFORM_H_HEADER_GUARD
|
||||||
|
|
||||||
|
// Architecture
|
||||||
|
#define BX_ARCH_32BIT 0
|
||||||
|
#define BX_ARCH_64BIT 0
|
||||||
|
|
||||||
|
// Compiler
|
||||||
#define BX_COMPILER_CLANG 0
|
#define BX_COMPILER_CLANG 0
|
||||||
#define BX_COMPILER_CLANG_ANALYZER 0
|
#define BX_COMPILER_CLANG_ANALYZER 0
|
||||||
#define BX_COMPILER_GCC 0
|
#define BX_COMPILER_GCC 0
|
||||||
#define BX_COMPILER_MSVC 0
|
#define BX_COMPILER_MSVC 0
|
||||||
#define BX_COMPILER_MSVC_COMPATIBLE 0
|
#define BX_COMPILER_MSVC_COMPATIBLE (BX_CRT_MSVC)
|
||||||
|
|
||||||
|
// Endianess
|
||||||
|
#define BX_CPU_ENDIAN_BIG 0
|
||||||
|
#define BX_CPU_ENDIAN_LITTLE 0
|
||||||
|
|
||||||
|
// CPU
|
||||||
|
#define BX_CPU_ARM 0
|
||||||
|
#define BX_CPU_JIT 0
|
||||||
|
#define BX_CPU_MIPS 0
|
||||||
|
#define BX_CPU_PPC 0
|
||||||
|
#define BX_CPU_RISCV 0
|
||||||
|
#define BX_CPU_X86 0
|
||||||
|
|
||||||
|
// C Runtime
|
||||||
|
#define BX_CRT_MSVC 0
|
||||||
|
#define BX_CRT_GLIBC 0
|
||||||
|
#define BX_CRT_NEWLIB 0
|
||||||
|
#define BX_CRT_MINGW 0
|
||||||
|
#define BX_CRT_MUSL 0
|
||||||
|
|
||||||
|
// Platform
|
||||||
#define BX_PLATFORM_ANDROID 0
|
#define BX_PLATFORM_ANDROID 0
|
||||||
#define BX_PLATFORM_EMSCRIPTEN 0
|
#define BX_PLATFORM_EMSCRIPTEN 0
|
||||||
#define BX_PLATFORM_BSD 0
|
#define BX_PLATFORM_BSD 0
|
||||||
@ -28,19 +53,6 @@
|
|||||||
#define BX_PLATFORM_XBOX360 0
|
#define BX_PLATFORM_XBOX360 0
|
||||||
#define BX_PLATFORM_XBOXONE 0
|
#define BX_PLATFORM_XBOXONE 0
|
||||||
|
|
||||||
#define BX_CPU_ARM 0
|
|
||||||
#define BX_CPU_JIT 0
|
|
||||||
#define BX_CPU_MIPS 0
|
|
||||||
#define BX_CPU_PPC 0
|
|
||||||
#define BX_CPU_RISCV 0
|
|
||||||
#define BX_CPU_X86 0
|
|
||||||
|
|
||||||
#define BX_ARCH_32BIT 0
|
|
||||||
#define BX_ARCH_64BIT 0
|
|
||||||
|
|
||||||
#define BX_CPU_ENDIAN_BIG 0
|
|
||||||
#define BX_CPU_ENDIAN_LITTLE 0
|
|
||||||
|
|
||||||
// http://sourceforge.net/apps/mediawiki/predef/index.php?title=Compilers
|
// http://sourceforge.net/apps/mediawiki/predef/index.php?title=Compilers
|
||||||
#if defined(__clang__)
|
#if defined(__clang__)
|
||||||
// clang defines __GNUC__ or _MSC_VER
|
// clang defines __GNUC__ or _MSC_VER
|
||||||
@ -51,17 +63,27 @@
|
|||||||
# define BX_COMPILER_CLANG_ANALYZER 1
|
# define BX_COMPILER_CLANG_ANALYZER 1
|
||||||
# endif // defined(__clang_analyzer__)
|
# endif // defined(__clang_analyzer__)
|
||||||
# if defined(_MSC_VER)
|
# if defined(_MSC_VER)
|
||||||
# undef BX_COMPILER_MSVC_COMPATIBLE
|
# undef BX_CRT_MSVC
|
||||||
# define BX_COMPILER_MSVC_COMPATIBLE _MSC_VER
|
# define BX_CRT_MSVC 1
|
||||||
# endif // defined(_MSC_VER)
|
# elif defined(__GLIBC__)
|
||||||
|
# undef BX_CRT_GLIBC
|
||||||
|
# define BX_CRT_GLIBC (__GLIBC__ * 10000 + __GLIBC_MINOR__ * 100)
|
||||||
|
# endif // defined(__GLIBC__)
|
||||||
#elif defined(_MSC_VER)
|
#elif defined(_MSC_VER)
|
||||||
# undef BX_COMPILER_MSVC
|
# undef BX_COMPILER_MSVC
|
||||||
# define BX_COMPILER_MSVC _MSC_VER
|
# define BX_COMPILER_MSVC _MSC_VER
|
||||||
# undef BX_COMPILER_MSVC_COMPATIBLE
|
# undef BX_CRT_MSVC
|
||||||
# define BX_COMPILER_MSVC_COMPATIBLE _MSC_VER
|
# define BX_CRT_MSVC 1
|
||||||
#elif defined(__GNUC__)
|
#elif defined(__GNUC__)
|
||||||
# undef BX_COMPILER_GCC
|
# undef BX_COMPILER_GCC
|
||||||
# define BX_COMPILER_GCC (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
|
# define BX_COMPILER_GCC (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
|
||||||
|
# if defined(__GLIBC__)
|
||||||
|
# undef BX_CRT_GLIBC
|
||||||
|
# define BX_CRT_GLIBC (__GLIBC__ * 10000 + __GLIBC_MINOR__ * 100)
|
||||||
|
# elif defined(__MINGW32__) || defined(__MINGW64__)
|
||||||
|
# undef BX_CRT_MINGW
|
||||||
|
# define BX_CRT_MINGW 1
|
||||||
|
# endif //
|
||||||
#else
|
#else
|
||||||
# error "BX_COMPILER_* is not defined!"
|
# error "BX_COMPILER_* is not defined!"
|
||||||
#endif //
|
#endif //
|
||||||
|
28
3rdparty/bx/include/bx/thread.h
vendored
28
3rdparty/bx/include/bx/thread.h
vendored
@ -6,27 +6,19 @@
|
|||||||
#ifndef BX_THREAD_H_HEADER_GUARD
|
#ifndef BX_THREAD_H_HEADER_GUARD
|
||||||
#define BX_THREAD_H_HEADER_GUARD
|
#define BX_THREAD_H_HEADER_GUARD
|
||||||
|
|
||||||
#define BX_USE_GLIBC_PTHREAD_SETNAME_NP 0
|
|
||||||
#if defined(__GLIBC__)
|
|
||||||
# if ( (__GLIBC__ > 2) || ( (__GLIBC__ == 2) && (__GLIBC_MINOR__ >= 12) ) )
|
|
||||||
# define BX_USE_GLIBC_PTHREAD_SETNAME_NP 1
|
|
||||||
# endif
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if BX_PLATFORM_POSIX
|
#if BX_PLATFORM_POSIX
|
||||||
# include <pthread.h>
|
# include <pthread.h>
|
||||||
# if BX_USE_GLIBC_PTHREAD_SETNAME_NP
|
# if defined(__FreeBSD__)
|
||||||
/* pthread.h provides pthread_setname_np */
|
|
||||||
# elif defined(BX_PLATFORM_LINUX)
|
|
||||||
# include <sys/prctl.h>
|
|
||||||
# elif defined(BX_PLATFORM_BSD)
|
|
||||||
# include <pthread_np.h>
|
# include <pthread_np.h>
|
||||||
# endif
|
# endif
|
||||||
|
# if BX_PLATFORM_LINUX && (BX_CRT_GLIBC < 21200)
|
||||||
|
# include <sys/prctl.h>
|
||||||
|
# endif // BX_PLATFORM_
|
||||||
#elif BX_PLATFORM_WINRT
|
#elif BX_PLATFORM_WINRT
|
||||||
using namespace Platform;
|
using namespace Platform;
|
||||||
using namespace Windows::Foundation;
|
using namespace Windows::Foundation;
|
||||||
using namespace Windows::System::Threading;
|
using namespace Windows::System::Threading;
|
||||||
#endif
|
#endif // BX_PLATFORM_
|
||||||
|
|
||||||
#include "sem.h"
|
#include "sem.h"
|
||||||
|
|
||||||
@ -165,16 +157,16 @@ namespace bx
|
|||||||
{
|
{
|
||||||
#if BX_PLATFORM_OSX || BX_PLATFORM_IOS
|
#if BX_PLATFORM_OSX || BX_PLATFORM_IOS
|
||||||
pthread_setname_np(_name);
|
pthread_setname_np(_name);
|
||||||
#elif BX_USE_GLIBC_PTHREAD_SETNAME_NP
|
#elif (BX_CRT_GLIBC >= 21200)
|
||||||
pthread_setname_np(m_handle, _name);
|
pthread_setname_np(m_handle, _name);
|
||||||
#elif BX_PLATFORM_LINUX
|
#elif BX_PLATFORM_LINUX
|
||||||
prctl(PR_SET_NAME,_name, 0, 0, 0);
|
prctl(PR_SET_NAME,_name, 0, 0, 0);
|
||||||
#elif BX_PLATFORM_BSD
|
#elif BX_PLATFORM_BSD
|
||||||
#ifdef __NetBSD__
|
# ifdef __NetBSD__
|
||||||
pthread_setname_np(m_handle, "%s", (void *)_name);
|
pthread_setname_np(m_handle, "%s", (void*)_name);
|
||||||
#else
|
# else
|
||||||
pthread_set_name_np(m_handle, _name);
|
pthread_set_name_np(m_handle, _name);
|
||||||
#endif
|
# endif // __NetBSD__
|
||||||
#elif BX_PLATFORM_WINDOWS && BX_COMPILER_MSVC
|
#elif BX_PLATFORM_WINDOWS && BX_COMPILER_MSVC
|
||||||
# pragma pack(push, 8)
|
# pragma pack(push, 8)
|
||||||
struct ThreadName
|
struct ThreadName
|
||||||
|
6
3rdparty/bx/include/compat/freebsd/alloca.h
vendored
6
3rdparty/bx/include/compat/freebsd/alloca.h
vendored
@ -1,5 +1,5 @@
|
|||||||
#ifdef __GLIBC__
|
#if defined(__GLIBC__)
|
||||||
#include_next <alloca.h>
|
# include_next <alloca.h>
|
||||||
#else
|
#else
|
||||||
#include <stdlib.h>
|
# include <stdlib.h>
|
||||||
#endif
|
#endif
|
||||||
|
6
3rdparty/bx/include/compat/freebsd/signal.h
vendored
6
3rdparty/bx/include/compat/freebsd/signal.h
vendored
@ -1,5 +1,5 @@
|
|||||||
#ifdef __GLIBC__
|
#if defined(__GLIBC__)
|
||||||
#include_next <signal.h>
|
# include_next <signal.h>
|
||||||
#else
|
#else
|
||||||
#include <sys/signal.h>
|
# include <sys/signal.h>
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user