fix(windows): resolve build failure and improve cross-platform support#13
Merged
Merged
Conversation
- Add .gitattributes to enforce LF line endings and UTF-8 without BOM - Introduce O2L_HAS_INT128 macro and is_long_ flag in Value to handle platforms without __int128 (MSVC/Windows) - Add holds_Int_Value/get_Int_Value/holds_Long_Value/get_Long_Value helpers for MSVC-safe variant access throughout all AST/Runtime files - Replace hardcoded variant index switch in ComparisonNode with type-safe holds_alternative chain to fix bad_variant_access on Windows - Fix JsonLibrary.cpp: revert 6 call sites back to holds_alternative<Int> for JsonValue contexts (distinct type from o2l::Value) - Fix tools/o2l-lsp-server/main.cpp: add popen/pclose aliases for MSVC - Add wininet and ws2_32 link targets for Windows in tests/CMakeLists.txt - Guard Unix-only path assertions in test_system_fs_path.cpp with _WIN32 ifdefs - Guard Int/Long identity tests in test_runtime.cpp with O2L_HAS_INT128 - Guard LongToIntConversion test with O2L_HAS_INT128 (Long==Int on MSVC) - Update README with Windows build instructions and CHANGELOG entry Closes zombocoder#2
d187a6c to
0ac2e11
Compare
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.
Fixes #2
Summary
.gitattributes— enforce LF line endings and UTF-8 without BOM across all text filessrc/Runtime/Value.hpp/cpp— introduceO2L_HAS_INT128macro andis_long_tag so theValuevariant works on platforms where__int128is unavailable (MSVC/Windows); addholds_Int_Value/get_Int_Value/holds_Long_Value/get_Long_Valueindex-based helpers for MSVC-safe variant accesssrc/files — replacestd::holds_alternative<Int/Long>andstd::get<Int/Long>calls with the new helpers (MSVC rejects type-based lookup when two variant alternatives share the same underlying type)tests/CMakeLists.txt— linkwininetandws2_32on Windowstests/test_system_fs_path.cpp— wrap Unix-only absolute-path assertions in#ifndef _WIN32; add Windows-specific equivalentsREADME.md— add Windows build instructions (MSVC 19.40, Ninja, vcpkg) satisfying the "clear instructions for Windows developers" acceptance criterionCHANGELOG.md— document the cross-OS milestoneTest plan
windows-latestrunnerubuntu-latestandmacos-latest