fix: Windows cross-compilation support (GOOS=windows)

- debugcli.go/debugtui.go: add //go:build !windows tag
- debugcli_windows.go/debugtui_windows.go: no-op stubs
- cdx/cdx.go: extract mmap to platform-specific files
- cdx/mmap_posix.go: syscall.Mmap/Munmap
- cdx/mmap_windows.go: no-op (falls back to read)
- ntx/ntx.go, ntx/build.go: same mmap extraction
- ntx/mmap_posix.go, ntx/mmap_windows.go: platform split

Builds verified: linux/amd64, windows/amd64, darwin/arm64, darwin/amd64

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-12 12:23:10 +09:00
parent 3ed246c47e
commit ad544a5528
11 changed files with 102 additions and 12 deletions

View File

@@ -1,3 +1,5 @@
//go:build !windows
// Copyright (c) 2026 Charles KWON OhJun (charleskwonohjun@gmail.com)
// All rights reserved.

13
hbrt/debugcli_windows.go Normal file
View File

@@ -0,0 +1,13 @@
//go:build windows
package hbrt
import "fmt"
// CLIDebugger returns a no-op debug callback on Windows.
func CLIDebugger() DebugCallback {
return func(event *DebugEvent) int {
fmt.Println("[debugger not available on Windows]")
return 0 // continue
}
}

View File

@@ -1,3 +1,5 @@
//go:build !windows
// Copyright (c) 2026 Charles KWON OhJun (charleskwonohjun@gmail.com)
// All rights reserved.

13
hbrt/debugtui_windows.go Normal file
View File

@@ -0,0 +1,13 @@
//go:build windows
package hbrt
import "fmt"
// TUIDebugger returns a no-op debug callback on Windows.
func TUIDebugger() DebugCallback {
return func(event *DebugEvent) int {
fmt.Println("[TUI debugger not available on Windows]")
return 0 // continue
}
}