work-around res_search on older glibcs
`res_search` became a proper symbol only in glibc 2.34. Until that it was re-defined in headers, hitting the (in-)famous https://github.com/ziglang/zig/issues/9485 glibc 2.34+: resolv/resolv.h:int res_search (const char *, int, int, unsigned char *, int) Old glibc: resolv/resolv.h:#define res_search __res_search Also, remove the toplevel includes, as they should never be included in the first place: the headers are included explicitly when needed.
This commit is contained in:
@@ -4,8 +4,9 @@ package main
|
||||
// #include <unistd.h>
|
||||
// #include <fcntl.h>
|
||||
// #include <stdio.h>
|
||||
// #include <resolv.h>
|
||||
// char* hello() { return "hello, world"; }
|
||||
// void phello() { printf("%s, your lucky number is %p\n", hello(), fcntl); }
|
||||
// void phello() { printf("%s, your lucky numbers are %p and %p\n", hello(), fcntl, res_search); }
|
||||
import "C"
|
||||
|
||||
func main() {
|
||||
|
||||
Reference in New Issue
Block a user