Add MSVC portability for runtime and generated startup - #21
Merged
Conversation
- psx_cyc.h / psx_cycles.c: _BitScanForward/_BitScanReverse shims for __builtin_ctz/__builtin_clz under _MSC_VER - full_function_emitter.cpp / main_psx.cpp: emit a portable .CRT$XCU init-pointer instead of GCC-only __attribute__((constructor)) in generated dispatch/game code - main.cpp: declare cross-language globals extern "C" so MSVC links them against their C definitions (no-op for GCC/Clang) Co-Authored-By: Claude Fable 5 <noreply@anthropic.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.
Summary
Add MSVC bit-scan intrinsics, generated .CRT$XCU startup initialization, and explicit C linkage for cross-language runtime globals while retaining the GCC/Clang constructor path.
Source and credit
Focused cherry-pick/adaptation of Martin Penkava's PR #16, exact source commit df4cc5c70ab1e5d0fd2a8f817dd346905d4d0eeb. Martin remains the commit author and the original Claude Fable 5 co-author trailer is preserved.
Deliberately excluded
No SmackDown scripts/data, discovery fallback, SPU, primitive rejection, Vulkan, CRT shader, or other PR #16 work is included.
Validation
Draft for focused review.