Skip to content

feat: add support for MacOS build with apple clang#405

Merged
taedlar merged 10 commits into
mainfrom
macos_build
Jun 4, 2026
Merged

feat: add support for MacOS build with apple clang#405
taedlar merged 10 commits into
mainfrom
macos_build

Conversation

@taedlar
Copy link
Copy Markdown
Owner

@taedlar taedlar commented Jun 3, 2026

No description provided.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds macOS (Apple Clang) build support by tightening cross-platform portability in formatting/logging paths, adjusting build/link dependencies, and extending CMake presets/tests to better tolerate platform-specific socket timing behavior.

Changes:

  • Added macOS ARM64 CMake configure/build/test presets and Apple-specific compiler warning flags.
  • Introduced xvasprintf() portability wrapper and migrated call sites away from platform-specific vasprintf / _vscprintf branches; replaced unsafe sprintf with snprintf.
  • Updated socket and string-related tests/logic to be more robust across platforms (accept/read polling, multibyte delimiter boundary handling).

Reviewed changes

Copilot reviewed 15 out of 15 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
tests/test_string_operators/test_string_operators.cpp Removes redundant free_svalue calls around stack reuse in string operator tests.
tests/test_socket_efuns/test_socket_efuns_behavior.cpp Makes socket accept/read tests more timing-tolerant; rebinding strategy for deterministic port selection.
src/simulate.c Routes fatal message formatting through xvasprintf() for portability.
src/main.h Updates variadic logging macros to forward __VA_ARGS__ (portable variadic macro usage).
src/frame.cpp Replaces sprintf with bounded snprintf.
src/comm.c Uses xvasprintf() for add_vmessage() formatting.
lib/socket/CMakeLists.txt Adjusts socket library link dependencies.
lib/port/xvasprintf.c Adds new portable xvasprintf() implementation.
lib/port/wrapper.h Exposes xvasprintf() in the portability wrapper API.
lib/port/debug.h Updates logging macros to use standard variadic forwarding.
lib/port/CMakeLists.txt Adds xvasprintf.c to the port library sources.
lib/lpc/CMakeLists.txt Changes generator tool and lpc library link dependencies.
lib/lpc/array.c Tightens multibyte delimiter matching conditions in explode_string().
CMakePresets.json Adds macOS ARM64 build/test presets.
CMakeLists.txt Adds Apple-specific compile warning options.

Comment thread lib/lpc/CMakeLists.txt Outdated
Comment thread src/main.h Outdated
Comment thread tests/test_socket_efuns/test_socket_efuns_behavior.cpp Outdated
Comment thread CMakePresets.json Outdated
@taedlar taedlar merged commit 39a2962 into main Jun 4, 2026
2 checks passed
@taedlar taedlar deleted the macos_build branch June 4, 2026 15:45
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.

2 participants