diff options
author | Wim <wim@42.be> | 2022-11-27 00:42:16 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-27 00:42:16 +0100 |
commit | 4fd0a7672777f0ed15692ae2ba47838208537558 (patch) | |
tree | b119834a8b9ee78aa8f1b2ad05efa7da50516cbf /vendor/modernc.org/libc/printf.go | |
parent | 6da9d567dc9195e9a5211f23a6795a41f56a1bfc (diff) | |
download | matterbridge-msglm-4fd0a7672777f0ed15692ae2ba47838208537558.tar.gz matterbridge-msglm-4fd0a7672777f0ed15692ae2ba47838208537558.tar.bz2 matterbridge-msglm-4fd0a7672777f0ed15692ae2ba47838208537558.zip |
Update dependencies (#1929)
Diffstat (limited to 'vendor/modernc.org/libc/printf.go')
-rw-r--r-- | vendor/modernc.org/libc/printf.go | 31 |
1 files changed, 26 insertions, 5 deletions
diff --git a/vendor/modernc.org/libc/printf.go b/vendor/modernc.org/libc/printf.go index b8200add..a26ad40e 100644 --- a/vendor/modernc.org/libc/printf.go +++ b/vendor/modernc.org/libc/printf.go @@ -7,6 +7,7 @@ package libc // import "modernc.org/libc" import ( "bytes" "fmt" + "runtime" "strconv" "strings" "unsafe" @@ -136,14 +137,17 @@ more: // the output is empty. format++ var arg int64 + if isWindows && mod == modL { + mod = modNone + } switch mod { - case modNone, modL, modLL, mod64: + case modL, modLL, mod64: arg = VaInt64(args) case modH: arg = int64(int16(VaInt32(args))) case modHH: arg = int64(int8(VaInt32(args))) - case mod32: + case mod32, modNone: arg = int64(VaInt32(args)) default: panic(todo("", mod)) @@ -167,6 +171,9 @@ more: // precision 0, the output is empty. format++ var arg uint64 + if isWindows && mod == modL { + mod = modNone + } switch mod { case modNone: arg = uint64(VaUint32(args)) @@ -200,6 +207,9 @@ more: // precision 0, the output is empty. format++ var arg uint64 + if isWindows && mod == modL { + mod = modNone + } switch mod { case modNone: arg = uint64(VaUint32(args)) @@ -284,6 +294,9 @@ more: // printed with an explicit precision 0, the output is empty. format++ var arg uint64 + if isWindows && mod == modL { + mod = modNone + } switch mod { case modNone: arg = uint64(VaUint32(args)) @@ -406,9 +419,17 @@ more: // The void * pointer argument is printed in hexadecimal (as if by %#x or // %#lx). format++ - arg := VaUintptr(args) - buf.WriteString("0x") - buf.WriteString(strconv.FormatInt(int64(arg), 16)) + switch runtime.GOOS { + case "windows": + switch runtime.GOARCH { + case "386", "arm": + fmt.Fprintf(buf, "%08X", VaUintptr(args)) + default: + fmt.Fprintf(buf, "%016X", VaUintptr(args)) + } + default: + fmt.Fprintf(buf, "%#0x", VaUintptr(args)) + } case 'c': // If no l modifier is present, the int argument is converted to an unsigned // char, and the resulting character is written. If an l modifier is present, |