* bx: Small platform detection/usage improvements
* Use BX_PLATFORM_POSIX where needed
The semaphone implementation already uses BX_PLATFORM_POSIX to include
<pthread.h> on all the POSIX platforms; do the same also in other places
for consistency. This is done also for <sched.h>, which is a POSIX API,
and sched_yield() from it is already guarded by BX_PLATFORM_POSIX.
* Drop support for GNU libc older than 2.12
glibc 2.12 was released on 2010, and at this point any supported Linux
distro has that version or way greather than that.
From bkaradzic/bx@b59b7debd3
* bx: fix <pthread/pthread.h> include on Hurd
<pthread/pthread.h> does not exist, the standard <pthread.h> does exist
so switch to it.
* osd/modules/file: use dirent::d_type on any GNU libc platform
This BSD extension is provided by GNU libc, so enable its usage with
that C library.
* osd/modules/file: use <pty.h> on any GNU libc platform
openpty() is implemented by GNU libc for all the OSes, so include
<pty.h> when using that C library.
* osd/modules/file: cast dirent::d_name to const char* before using it
According to POSIX [1], the type of dirent::d_name is loosely defined
as "char d_name[]", as array with an undefined size. In particular, few
ways are seen in the wild:
(a) "char d_name[size]", i.e. as proper array with a full size
(b) "char d_name[1]"/"char d_name[0]", i.e. as C flexible arrays
Regardless of its type, dirent::d_name is used as if it was a classic
const char *, i.e. as pointer to a null-terminated string.
util::string_format() uses C++ templates to collect all the arguments,
and thus it will use the actual type of dirent::d_name. In case of (a)
there is no issue, however for (b) the result is that only the first
character is used.
To ensure that dirent::d_name is fully used, explicitly cast it to
const char * before passing it to util::string_format(), so the whole
string is used.
[1] https://pubs.opengroup.org/onlinepubs/9699919799/basedefs/dirent.h.html
* Updated to GENie 1181.
* Applied local fix for GENie resource include directory bug, sent upstream as bkaradzic/GENie#572.
* Set MSVC flags to use conformant preprocessor, standards conformance mode, and assume UTF-8 encoding.
* Sync with bgfx upstream revision b91d0b6
* Sync with bx upstream revision d60912b
* Sync with bimg upstream revision bd81f60
* Add astc-codec decoder
* Rename VertexDecl to VertexLayout
* Rename UniformType enum Int1 to Sampler.
* Add NVN stub
* Fix unused-const-variable error on macOS
* Drop redundant explicit language parameters
buildoptions_cpp are only applied to c++ files and buildoptions_objcpp are only
applied to objective c++ files. As such, hardcoding -x offers no benefit while
preventing overrides (such as one needed by 3rdparty/bgfx/src/renderer_vk.cpp on
macOS) from working.
* Re-introduce -x c++ in places where C code is compiled as C++ to prevent clang from throwing a warning
* Build bgfx as Objective-C++ on macOS
It is needed due to included headers
* Enable Direct3D12 and Vulkan bgfx rendering backends
* Enable building of spirv shaders
* Properly escape /c in cmd call
* Comment out dx12 bgfx renderer
* Honor VERBOSE setting during shaders build
* Only invert hlsl shader XYZ_TO_sRGB matrix for opengl
* Add spirv shaders
* OpenGL ES needs transposed matrix too
* Metal needs transposed matrix as well
Trying to evaluate __GLIBC__ will result in an error if is not defined,
if the preprocessor does not short-cut the evaluation.
Split the macros onto separate lines and define the result in a new
BX_USE_GLIBC_PTHREAD_SETNAME_NP macro to avoid duplication.
Fix potential compilation error by ensuring __GLIBC__ is only evaluated
when actually defined.
When __GLIBC__ is defined, we do not need any additional headers on BSD
platforms (hence why using #elif).
I've filed a more complete patch for this upstream:
https://github.com/bkaradzic/bx/pull/61
but this has been ignored since June. This patch is the minimal
set to fix the build on NetBSD.