Skip to content

build: fix Linux compilation (atomics, strchrnul, font macros, libm, …#753

Open
ozy24 wants to merge 1 commit intomainfrom
ozdev
Open

build: fix Linux compilation (atomics, strchrnul, font macros, libm, …#753
ozy24 wants to merge 1 commit intomainfrom
ozdev

Conversation

@ozy24
Copy link
Collaborator

@ozy24 ozy24 commented Mar 8, 2026

Fix Linux build (atomics, strchrnul, font macros, libm, OpenAL)
Fixes Linux build failures and keeps Windows builds working.

Changes

  1. renderer.cpp – strchrnul C++ overload

Added R_Q_strchrnul wrapper to resolve C++ overload ambiguity with glibc’s strchrnul
Wrapper uses Q_strchrnul when HAVE_STRCHRNUL is not defined (e.g. on Windows)
2. inc/shared/atomic.h – C++ atomics

Added C++ path for atomic_int, atomic_load, atomic_store using std::atomic from
Keeps existing MSVC path; C++ branch only used when not MSVC
3. src/client/font.cpp – min/max macro conflict

Define NOMINMAX before including font.h so min/max don’t conflict with std::min/std::max from
4. meson.build – OpenGL renderer and OpenAL

Link OpenGL renderer against libm for math symbols (tanf, sincosf, expf, etc.)
Add -mno-direct-extern-access for client C++ when OpenAL is used on Linux to work around Fedora/binutils “non-canonical reference to canonical protected function” linker errors
Use client_link_args for the client executable
Platforms
Linux: Builds successfully (Fedora tested)
Windows: Unchanged; R_Q_strchrnul uses Q_strchrnul when strchrnul is unavailable

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant