feat: add support for MacOS build with apple clang#405
Merged
Conversation
Contributor
There was a problem hiding this comment.
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-specificvasprintf/_vscprintfbranches; replaced unsafesprintfwithsnprintf. - 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. |
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.