wintun: align 64-bit argument on ARM32

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2021-10-26 14:51:44 +02:00
parent 828a885a71
commit e42c6c4bc2

View file

@ -53,10 +53,14 @@ func logMessage(level loggerLevel, timestamp uint64, msg *uint16) int {
func setupLogger(dll *lazyDLL) { func setupLogger(dll *lazyDLL) {
var callback uintptr var callback uintptr
if runtime.GOARCH == "386" || runtime.GOARCH == "arm" { if runtime.GOARCH == "386" {
callback = windows.NewCallback(func(level loggerLevel, timestampLow, timestampHigh uint32, msg *uint16) int { callback = windows.NewCallback(func(level loggerLevel, timestampLow, timestampHigh uint32, msg *uint16) int {
return logMessage(level, uint64(timestampHigh)<<32|uint64(timestampLow), msg) return logMessage(level, uint64(timestampHigh)<<32|uint64(timestampLow), msg)
}) })
} else if runtime.GOARCH == "arm" {
callback = windows.NewCallback(func(level loggerLevel, _, timestampLow, timestampHigh uint32, msg *uint16) int {
return logMessage(level, uint64(timestampHigh)<<32|uint64(timestampLow), msg)
})
} else if runtime.GOARCH == "amd64" || runtime.GOARCH == "arm64" { } else if runtime.GOARCH == "amd64" || runtime.GOARCH == "arm64" {
callback = windows.NewCallback(logMessage) callback = windows.NewCallback(logMessage)
} }