Skip to content

Commit

Permalink
generate longlong for gen_slice on windows
Browse files Browse the repository at this point in the history
  • Loading branch information
rcoreilly committed May 3, 2024
1 parent feb8731 commit 5fb6831
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion bind/gen_slice.go
Original file line number Diff line number Diff line change
Expand Up @@ -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")

Expand Down

0 comments on commit 5fb6831

Please sign in to comment.