gokogiri
gokogiri copied to clipboard
include stdlib.h in xpath/expression.go
Hello, Thank you for maintaining gokogiri. gokogiri is included in code that I want to cross compile. Cross compilation of xpath/expression.go fails with the error "could not determine kind of name for C.free". Including stdlib.h in xpath/expression.go solves the problem. I am not aware of an other way to solve the problem. Thank you for your help with this matter.
@jbowtie could we get this merged if it's acceptable?
I have no problem with merging this, I just haven't had time to update the 5-year-old build pipeline to do a proper release.
After adding a go.mod
file there's just one compile error. Do you know what to do?
$ gotest ./...
# github.com/moovweb/rubex
chelper.c:26:11: error: call to undeclared function 'onig_new_default'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration]
chelper.c:26:11: note: did you mean 'onig_new_deluxe'?
/usr/local/include/oniguruma.h:822:5: note: 'onig_new_deluxe' declared here
chelper.c:159:43: warning: passing 'const OnigUChar *' (aka 'const unsigned char *') to parameter of type 'const char *' converts between pointers to integer types where one is of the unique plain 'char' type and the other is not [-Wpointer-sign]
/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/secure/_string.h:128:34: note: expanded from macro 'strncpy'
# github.com/jbowtie/gokogiri/xpath.test