Skip to content

Commit

Permalink
use proper type for hs_compile_lit's argument
Browse files Browse the repository at this point in the history
Argument len is size_t, not ulong. Fix the following error on i686-w64-mingw32:
compile_v52.go:40:73: cannot use _Ctype_ulong(len(expression)) (value of type
_Ctype_ulong) as type _Ctype_uint in variable declaration
  • Loading branch information
starius committed Dec 31, 2024
1 parent 9dd8ff1 commit c15d8d5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion internal/hs/compile_v52.go
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ func CompileLit(expression string, flags CompileFlag, mode ModeFlag, info *Platf

defer C.free(unsafe.Pointer(expr))

ret := C.hs_compile_lit(expr, C.uint(flags), C.ulong(len(expression)), C.uint(mode), platform, &db, &err)
ret := C.hs_compile_lit(expr, C.uint(flags), C.size_t(len(expression)), C.uint(mode), platform, &db, &err)

if err != nil {
defer C.hs_free_compile_error(err)
Expand Down

0 comments on commit c15d8d5

Please sign in to comment.