Skip to content

Fix Windows build with clang: replace swprintf_s with portable alternative #102

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

prolic
Copy link

@prolic prolic commented May 27, 2025

Use conditional compilation to call swprintf() when building with clang instead of swprintf_s(), which depends on the Microsoft-specific __local_stdio_printf_options symbol that's not available with LLVM's linker.

This resolves the linker error:
ld.lld: error: undefined symbol: __local_stdio_printf_options

The change maintains compatibility with both MSVC (using swprintf_s) and clang (using standard swprintf) while preserving the same functionality.

resolves #101

Conditionally use swprintf() for clang to avoid undefined symbol
__local_stdio_printf_options while keeping swprintf_s() for MSVC.

Resolves Windows build failure with LLVM/clang linker.
@prolic
Copy link
Author

prolic commented Jun 30, 2025

ping @bgamari @AndreasPK @TravisWhitaker

@TravisWhitaker
Copy link

Seems right to me.

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.

Bug on mingw64 windows builds
2 participants