ipsn / go-libtor

Self-contained Tor from Go
BSD 3-Clause "New" or "Revised" License
544 stars 46 forks source link

add include to zlib #16

Closed rehacktive closed 4 years ago

rehacktive commented 4 years ago

When I compile (and use) this library, I got a lot of warnings like:

# github.com/ipsn/go-libtor/libtor In file included from ../../go/pkg/mod/github.com/ipsn/go-libtor@v1.0.116/libtor/zlib_gzlib.go:7:0: ../../go/pkg/mod/github.com/ipsn/go-libtor@v1.0.116/libtor/../zlib/gzlib.c: In function ‘gz_open’: ../../go/pkg/mod/github.com/ipsn/go-libtor@v1.0.116/libtor/../zlib/gzlib.c:14:17: warning: implicit declaration of function ‘lseek’ [-Wimplicit-function-declaration]

This PR should avoid these warnings, adding specific includes.

rehacktive commented 4 years ago

@karalabe any chance to consider this? it happens all the time I compile (and run!) projects using this library.

ciehanski commented 4 years ago

+1

cpacia commented 4 years ago

Any movement on this? Everyone has to use a fork until this is merged.

karalabe commented 4 years ago

The issue with this PR is that it modifies zlib itself, which we just pull as is in a nightly build job. If some include files need to be added, those should be added to the builder in https://github.com/ipsn/go-libtor/blob/master/build/wrap.go

rehacktive commented 4 years ago

okay @karalabe , so feel free to close this. it would be great to make that change on the wrapper (unfortunately in this moment I got no time at all), this issue is quite annoying.

karalabe commented 4 years ago

Ok, found the issue. Zlib also has a configure step, which I skip, but which modifies 2 defines. For all the other libraries, I have complex configurations, but zlib I just wrapped and left as is, so I missed the two defines, causing the headers to not be included. Working on a fix now.

karalabe commented 4 years ago

Hopefully the issue is fixed now. Please try out latest master and open an issue if something still persists. Thx.