[pull] main from ghostty-org:main#698
Merged
pull[bot] merged 3 commits intoCrazyForks:mainfrom Apr 23, 2026
Merged
Conversation
Part of preparation for upstreaming a Win32 application runtime (see discussion #2563). This is one of three small build-related fixes that unblock the Windows GNU-ABI library build. When targeting Windows with GNU ABI, the existing `DllMain` declaration falls through to `void` (a type), which Zig stdlib's `start.zig` then attempts to call as a function via `root.DllMain(...)` - producing the compile error "type 'type' not a function". Restructure the conditional so that: - non-Windows builds keep `DllMain = void` - Windows + MSVC keeps the existing CRT-init handler (unchanged) - Windows + non-MSVC gets a no-op `BOOL` handler This unblocks `zig build -Dtarget=native-native-gnu -Dapp-runtime=none` on Windows.
Per review feedback (#12373), fold the nested `if/else if/else` into a single Windows-gated struct whose handler picks up the abi difference via a comptime check. This removes the duplicated `const BOOL = ...` block that the two per-abi structs shared.
Part of preparation for adding a Win32 application runtime (discussion #2563). One of three small, independent build fixes that together unblock the Windows GNU-ABI library build. On Windows with non-MSVC ABI, `pub const DllMain` resolved to `void` (a type), and Zig's stdlib `start.zig` then tried to call it as a function via `root.DllMain(...)`, failing to compile with "type 'type' not a function". This restructures the conditional so MSVC keeps its existing CRT-init handler unchanged, non-MSVC Windows gets a no-op `BOOL` handler, and non-Windows continues to resolve to `void`. Verified: `zig build -Dtarget=native-native-gnu -Dapp-runtime=none [-Doptimize=ReleaseSafe]` now builds cleanly on Windows.
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
See Commits and Changes for more details.
Created by
pull[bot] (v2.0.0-alpha.4)
Can you help keep this open source service alive? 💖 Please sponsor : )