From 5fb68318e0eb98bcc338a014940e092d4ccc4fb2 Mon Sep 17 00:00:00 2001 From: "Randall C. O'Reilly" Date: Fri, 3 May 2024 15:27:38 -0700 Subject: [PATCH] generate longlong for gen_slice on windows --- bind/gen_slice.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/bind/gen_slice.go b/bind/gen_slice.go index c0ef885..8df9ded 100644 --- a/bind/gen_slice.go +++ b/bind/gen_slice.go @@ -409,7 +409,11 @@ otherwise parameter is a python list that we copy from g.gofile.Printf("s := deptrFromHandle_Slice_byte(handle)\n") g.gofile.Printf("ptr := unsafe.Pointer(&s[0])\n") g.gofile.Printf("size := len(s)\n") - g.gofile.Printf("return C.PyBytes_FromStringAndSize((*C.char)(ptr), C.long(size))\n") + if WindowsOS { + g.gofile.Printf("return C.PyBytes_FromStringAndSize((*C.char)(ptr), C.longlong(size))\n") + } else { + g.gofile.Printf("return C.PyBytes_FromStringAndSize((*C.char)(ptr), C.long(size))\n") + } g.gofile.Outdent() g.gofile.Printf("}\n\n")