Fixed incorrect OS detection

This commit is contained in:
2025-01-31 21:50:35 +01:00
parent 6163ba547e
commit 8de582abf6
8 changed files with 65 additions and 25 deletions

View File

@ -31,11 +31,11 @@ func (a Assembler) Finalize(dlls dll.List) ([]byte, []byte) {
)
switch config.TargetOS {
case "linux":
case config.Linux:
headerEnd = elf.HeaderEnd
case "macos":
case config.Mac:
headerEnd = macho.HeaderEnd
case "windows":
case config.Windows:
headerEnd = pe.HeaderEnd
}
@ -443,7 +443,7 @@ restart:
binary.LittleEndian.PutUint32(slice, uint32(address))
}
if config.TargetOS == "windows" {
if config.TargetOS == config.Windows {
if len(data) == 0 {
data = []byte{0}
}