Skip to content

Commit 5fb6831

Browse files
committed
generate longlong for gen_slice on windows
1 parent feb8731 commit 5fb6831

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bind/gen_slice.go

+5-1
Original file line numberDiff line numberDiff line change
@@ -409,7 +409,11 @@ otherwise parameter is a python list that we copy from
409409
g.gofile.Printf("s := deptrFromHandle_Slice_byte(handle)\n")
410410
g.gofile.Printf("ptr := unsafe.Pointer(&s[0])\n")
411411
g.gofile.Printf("size := len(s)\n")
412-
g.gofile.Printf("return C.PyBytes_FromStringAndSize((*C.char)(ptr), C.long(size))\n")
412+
if WindowsOS {
413+
g.gofile.Printf("return C.PyBytes_FromStringAndSize((*C.char)(ptr), C.longlong(size))\n")
414+
} else {
415+
g.gofile.Printf("return C.PyBytes_FromStringAndSize((*C.char)(ptr), C.long(size))\n")
416+
}
413417
g.gofile.Outdent()
414418
g.gofile.Printf("}\n\n")
415419

0 commit comments

Comments
 (0)