diff options
author | 2016-05-03 12:20:29 +0200 | |
---|---|---|
committer | 2016-05-03 12:20:29 +0200 | |
commit | f97b68d3ed8312f0800fc0e501ad0174a968d3e9 (patch) | |
tree | bf876c8732bd657d05908876ae88e1736f306610 /3rdparty/bx | |
parent | f2aca844f6bbfcc0d1284d6dd546cd552cbe0a92 (diff) |
Update GENie, BGFX and BX (nw)
Diffstat (limited to '3rdparty/bx')
-rw-r--r-- | 3rdparty/bx/include/bx/string.h | 20 | ||||
-rw-r--r-- | 3rdparty/bx/include/bx/thread.h | 4 | ||||
-rw-r--r-- | 3rdparty/bx/makefile | 31 | ||||
-rw-r--r-- | 3rdparty/bx/scripts/bin2c.lua | 5 | ||||
-rw-r--r-- | 3rdparty/bx/scripts/toolchain.lua | 66 | ||||
-rw-r--r-- | 3rdparty/bx/tools/bin/darwin/bin2c | bin | 0 -> 25572 bytes | |||
-rwxr-xr-x | 3rdparty/bx/tools/bin/darwin/genie | bin | 442656 -> 442656 bytes | |||
-rw-r--r-- | 3rdparty/bx/tools/bin/linux/bin2c | bin | 0 -> 135938 bytes | |||
-rwxr-xr-x | 3rdparty/bx/tools/bin/linux/genie | bin | 417336 -> 417336 bytes | |||
-rw-r--r-- | 3rdparty/bx/tools/bin/windows/bin2c.exe | bin | 0 -> 818437 bytes | |||
-rw-r--r-- | 3rdparty/bx/tools/bin/windows/genie.exe | bin | 419840 -> 421376 bytes |
11 files changed, 81 insertions, 45 deletions
diff --git a/3rdparty/bx/include/bx/string.h b/3rdparty/bx/include/bx/string.h index 5dc5a434751..640de064910 100644 --- a/3rdparty/bx/include/bx/string.h +++ b/3rdparty/bx/include/bx/string.h @@ -14,12 +14,16 @@ #include <string.h> #include <wchar.h> // wchar_t +#ifndef va_copy +# define va_copy(_a, _b) (_a) = (_b) +#endif // va_copy + namespace bx { /// inline bool toBool(const char* _str) { - char ch = (char)tolower(_str[0]); + char ch = (char)::tolower(_str[0]); return ch == 't' || ch == '1'; } @@ -27,9 +31,9 @@ namespace bx inline int32_t stricmp(const char* _a, const char* _b) { #if BX_COMPILER_MSVC_COMPATIBLE - return _stricmp(_a, _b); + return ::_stricmp(_a, _b); #else - return strcasecmp(_a, _b); + return ::strcasecmp(_a, _b); #endif // BX_COMPILER_ } @@ -307,7 +311,10 @@ namespace bx inline int32_t vsnprintf(char* _str, size_t _count, const char* _format, va_list _argList) { #if BX_COMPILER_MSVC - int32_t len = ::vsnprintf_s(_str, _count, size_t(-1), _format, _argList); + va_list argListCopy; + va_copy(argListCopy, _argList); + int32_t len = ::vsnprintf_s(_str, _count, size_t(-1), _format, argListCopy); + va_end(argListCopy); return -1 == len ? ::_vscprintf(_format, _argList) : len; #else return ::vsnprintf(_str, _count, _format, _argList); @@ -320,7 +327,10 @@ namespace bx inline int32_t vsnwprintf(wchar_t* _str, size_t _count, const wchar_t* _format, va_list _argList) { #if BX_COMPILER_MSVC - int32_t len = ::_vsnwprintf_s(_str, _count, size_t(-1), _format, _argList); + va_list argListCopy; + va_copy(argListCopy, _argList); + int32_t len = ::_vsnwprintf_s(_str, _count, size_t(-1), _format, argListCopy); + va_end(argListCopy); return -1 == len ? ::_vscwprintf(_format, _argList) : len; #elif defined(__MINGW32__) return ::vsnwprintf(_str, _count, _format, _argList); diff --git a/3rdparty/bx/include/bx/thread.h b/3rdparty/bx/include/bx/thread.h index 0cdc1f45438..532ae87c703 100644 --- a/3rdparty/bx/include/bx/thread.h +++ b/3rdparty/bx/include/bx/thread.h @@ -161,7 +161,11 @@ namespace bx prctl(PR_SET_NAME,_name, 0, 0, 0); # endif // defined(__GLIBC__) ... #elif BX_PLATFORM_BSD +#ifdef __NetBSD__ + pthread_setname_np(m_handle, "%s", (void *)_name); +#else pthread_setname_np(m_handle, _name); +#endif #elif BX_PLATFORM_WINDOWS && BX_COMPILER_MSVC # pragma pack(push, 8) struct ThreadName diff --git a/3rdparty/bx/makefile b/3rdparty/bx/makefile index 685479b05d8..5d0ecbd8b7d 100644 --- a/3rdparty/bx/makefile +++ b/3rdparty/bx/makefile @@ -3,17 +3,6 @@ # License: http://www.opensource.org/licenses/BSD-2-Clause # -UNAME := $(shell uname) -ifeq ($(UNAME),$(filter $(UNAME),Linux Darwin)) -ifeq ($(UNAME),$(filter $(UNAME),Darwin)) -OS=darwin -else -OS=linux -endif -else -OS=windows -endif - GENIE=../bx/tools/bin/$(OS)/genie all: @@ -213,14 +202,28 @@ BUILD_TOOLS_CONFIG=release32 EXE=.exe endif -.build/$(BUILD_OUTPUT_DIR)/bin/bin2cRelease$(EXE): .build/projects/$(BUILD_PROJECT_DIR) - $(SILENT) make -C .build/projects/$(BUILD_PROJECT_DIR) -f bin2c.make config=$(BUILD_TOOLS_CONFIG) +.build/osx64_clang/bin/bin2cRelease: .build/projects/gmake-osx + $(SILENT) make -C .build/projects/gmake-osx bin2c config=$(BUILD_TOOLS_CONFIG) + +tools/bin/darwin/bin2c: .build/osx64_clang/bin/bin2cRelease + $(SILENT) cp $(<) $(@) + +.build/linux64_gcc/bin/bin2cRelease: .build/projects/gmake-linux + $(SILENT) make -C .build/projects/gmake-linux bin2c config=$(BUILD_TOOLS_CONFIG) -tools/bin/$(OS)/bin2c$(EXE): .build/$(BUILD_OUTPUT_DIR)/bin/bin2cRelease$(EXE) +tools/bin/linux/bin2c: .build/linux64_gcc/bin/bin2cRelease + $(SILENT) cp $(<) $(@) + +.build/win64_mingw-gcc/bin/bin2cRelease.exe: .build/projects/gmake-mingw-gcc + $(SILENT) make -C .build/projects/gmake-mingw-gcc bin2c config=$(BUILD_TOOLS_CONFIG) + +tools/bin/windows/bin2c.exe: .build/win64_mingw-gcc/bin/bin2cRelease $(SILENT) cp $(<) $(@) tools: tools/bin/$(OS)/bin2c$(EXE) +dist: tools/bin/darwin/bin2c tools/bin/linux/bin2c tools/bin/windows/bin2c.exe + .build/$(BUILD_OUTPUT_DIR)/bin/bx.testRelease$(EXE): .build/projects/$(BUILD_PROJECT_DIR) $(SILENT) make -C .build/projects/$(BUILD_PROJECT_DIR) bx.test config=$(BUILD_TOOLS_CONFIG) diff --git a/3rdparty/bx/scripts/bin2c.lua b/3rdparty/bx/scripts/bin2c.lua index 39f193f3bca..82b3a7a1771 100644 --- a/3rdparty/bx/scripts/bin2c.lua +++ b/3rdparty/bx/scripts/bin2c.lua @@ -16,4 +16,9 @@ project "bin2c" "../tools/bin2c/**.h", } + configuration { "mingw-*" } + targetextension ".exe" + configuration {} + + strip() diff --git a/3rdparty/bx/scripts/toolchain.lua b/3rdparty/bx/scripts/toolchain.lua index 49ed9bd9885..77e7132d30a 100644 --- a/3rdparty/bx/scripts/toolchain.lua +++ b/3rdparty/bx/scripts/toolchain.lua @@ -13,31 +13,30 @@ function toolchain(_buildDir, _libDir) value = "GCC", description = "Choose GCC flavor", allowed = { - { "android-arm", "Android - ARM" }, - { "android-mips", "Android - MIPS" }, - { "android-x86", "Android - x86" }, - { "asmjs", "Emscripten/asm.js" }, - { "freebsd", "FreeBSD" }, - { "ios-arm", "iOS - ARM" }, - { "ios-simulator", "iOS - Simulator" }, - { "linux-gcc", "Linux (GCC compiler)" }, - { "linux-gcc-5", "Linux (GCC-5 compiler)" }, - { "linux-clang", "Linux (Clang compiler)" }, - { "linux-mips-gcc", "Linux (MIPS, GCC compiler)" }, - { "linux-arm-gcc", "Linux (ARM, GCC compiler)" }, - { "linux-steamlink", "Steam Link" }, - { "tvos-arm64", "tvOS - ARM64" }, - { "tvos-simulator", "tvOS - Simulator" }, - { "mingw-gcc", "MinGW" }, - { "mingw-clang", "MinGW (clang compiler)" }, - { "nacl", "Native Client" }, - { "nacl-arm", "Native Client - ARM" }, - { "osx", "OSX" }, - { "pnacl", "Native Client - PNaCl" }, - { "ps4", "PS4" }, - { "qnx-arm", "QNX/Blackberry - ARM" }, - { "rpi", "RaspberryPi" }, - { "riscv", "RISC-V" }, + { "android-arm", "Android - ARM" }, + { "android-mips", "Android - MIPS" }, + { "android-x86", "Android - x86" }, + { "asmjs", "Emscripten/asm.js" }, + { "freebsd", "FreeBSD" }, + { "linux-gcc", "Linux (GCC compiler)" }, + { "linux-gcc-5", "Linux (GCC-5 compiler)" }, + { "linux-clang", "Linux (Clang compiler)" }, + { "linux-mips-gcc", "Linux (MIPS, GCC compiler)" }, + { "linux-arm-gcc", "Linux (ARM, GCC compiler)" }, + { "ios-arm", "iOS - ARM" }, + { "ios-simulator", "iOS - Simulator" }, + { "tvos-arm64", "tvOS - ARM64" }, + { "tvos-simulator", "tvOS - Simulator" }, + { "mingw-gcc", "MinGW" }, + { "mingw-clang", "MinGW (clang compiler)" }, + { "nacl", "Native Client" }, + { "nacl-arm", "Native Client - ARM" }, + { "netbsd", "NetBSD" }, + { "osx", "OSX" }, + { "pnacl", "Native Client - PNaCl" }, + { "ps4", "PS4" }, + { "qnx-arm", "QNX/Blackberry - ARM" }, + { "rpi", "RaspberryPi" }, }, } @@ -283,6 +282,9 @@ function toolchain(_buildDir, _libDir) premake.gcc.ar = naclToolchain .. "ar" location (path.join(_buildDir, "projects", _ACTION .. "-nacl-arm")) + elseif "netbsd" == _OPTIONS["gcc"] then + location (path.join(_buildDir, "projects", _ACTION .. "-netbsd")) + elseif "osx" == _OPTIONS["gcc"] then if os.is("linux") then @@ -440,6 +442,7 @@ function toolchain(_buildDir, _libDir) configuration { "Release" } flags { + "NoBufferSecurityCheck", "OptimizeSpeed", } targetsuffix "Release" @@ -543,7 +546,10 @@ function toolchain(_buildDir, _libDir) libdirs { path.join(_libDir, "lib/win32_mingw-gcc"), } - buildoptions { "-m32" } + buildoptions { + "-m32", + "-mstackrealign", + } configuration { "x64", "mingw-gcc" } targetdir (path.join(_buildDir, "win64_mingw-gcc/bin")) @@ -944,6 +950,14 @@ function toolchain(_buildDir, _libDir) "NOMINMAX", } + configuration { "netbsd" } + targetdir (path.join(_buildDir, "netbsd/bin")) + objdir (path.join(_buildDir, "netbsd/obj")) + libdirs { path.join(_libDir, "lib/netbsd") } + includedirs { + path.join(bxDir, "include/compat/freebsd"), + } + configuration { "osx", "x32" } targetdir (path.join(_buildDir, "osx32_clang/bin")) objdir (path.join(_buildDir, "osx32_clang/obj")) diff --git a/3rdparty/bx/tools/bin/darwin/bin2c b/3rdparty/bx/tools/bin/darwin/bin2c Binary files differnew file mode 100644 index 00000000000..eb1fa8e034c --- /dev/null +++ b/3rdparty/bx/tools/bin/darwin/bin2c diff --git a/3rdparty/bx/tools/bin/darwin/genie b/3rdparty/bx/tools/bin/darwin/genie Binary files differindex 711b1d11897..76ea0372048 100755 --- a/3rdparty/bx/tools/bin/darwin/genie +++ b/3rdparty/bx/tools/bin/darwin/genie diff --git a/3rdparty/bx/tools/bin/linux/bin2c b/3rdparty/bx/tools/bin/linux/bin2c Binary files differnew file mode 100644 index 00000000000..b862dae33a5 --- /dev/null +++ b/3rdparty/bx/tools/bin/linux/bin2c diff --git a/3rdparty/bx/tools/bin/linux/genie b/3rdparty/bx/tools/bin/linux/genie Binary files differindex 51f11086241..910b28098e0 100755 --- a/3rdparty/bx/tools/bin/linux/genie +++ b/3rdparty/bx/tools/bin/linux/genie diff --git a/3rdparty/bx/tools/bin/windows/bin2c.exe b/3rdparty/bx/tools/bin/windows/bin2c.exe Binary files differnew file mode 100644 index 00000000000..143fffd09dd --- /dev/null +++ b/3rdparty/bx/tools/bin/windows/bin2c.exe diff --git a/3rdparty/bx/tools/bin/windows/genie.exe b/3rdparty/bx/tools/bin/windows/genie.exe Binary files differindex d33aa269725..356155ae32a 100644 --- a/3rdparty/bx/tools/bin/windows/genie.exe +++ b/3rdparty/bx/tools/bin/windows/genie.exe |