sahlberg / libnfs

NFS client library
Other
510 stars 200 forks source link

Fix include sys/time.h #479

Closed ffontaine closed 1 month ago

ffontaine commented 1 month ago

POSIX says struct timeval is defined if <sys/time.h> is included.

Instead of the mess that is currently done based on the system on which the stuff is being compiled, always include it except when _WIN32 is defined.

This will fix the following build failure on musl for any applications using libnfs (e.g., mpd):

$SYSROOT/usr/include/nfsc/libnfs.h:965:23: error: field 'atime' has incomplete type 'timeval'
        struct timeval atime;

Fix #272