mirror of
https://github.com/bkaradzic/bimg.git
synced 2026-06-08 02:43:48 +00:00
nvtt: posh.h — switch EMSCRIPTEN macro to __EMSCRIPTEN__ (#126)
emsdk >= 5.0 no longer predefines the legacy `EMSCRIPTEN` macro, only `__EMSCRIPTEN__` (see emscripten-core/emscripten#21899). Switch posh's OS+CPU detection to the modern spelling so vendored nvtt builds under current emsdk. Without this, posh falls through to "unknown OS", defsgnuclinux.h is never included, `#define restrict __restrict__` never runs, and nvcore/utils.h ships bare `restrict` into clang which rejects it ("expected ')'"). POSH_CPU detection then also fails with "POSH cannot determine target CPU". Suggested by @bkaradzic — drop the legacy spelling rather than add `__EMSCRIPTEN__` alongside it.
This commit is contained in:
6
3rdparty/nvtt/nvcore/posh.h
vendored
6
3rdparty/nvtt/nvcore/posh.h
vendored
@@ -298,8 +298,8 @@ LLVM:
|
||||
** Determine target operating system
|
||||
** ----------------------------------------------------------------------------
|
||||
*/
|
||||
#if defined linux || defined __linux__ || defined EMSCRIPTEN
|
||||
# define POSH_OS_LINUX 1
|
||||
#if defined linux || defined __linux__ || defined __EMSCRIPTEN__
|
||||
# define POSH_OS_LINUX 1
|
||||
# define POSH_OS_STRING "Linux"
|
||||
#endif
|
||||
|
||||
@@ -548,7 +548,7 @@ LLVM:
|
||||
# define POSH_CPU_STRING "PA-RISC"
|
||||
#endif
|
||||
|
||||
#if defined EMSCRIPTEN
|
||||
#if defined __EMSCRIPTEN__
|
||||
# define POSH_CPU_EMSCRIPTEN 1
|
||||
# define POSH_CPU_STRING "EMSCRIPTEN"
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user