Fix compilation error on FreeBSD
authorFrédéric Fauberteau <triaxx@NetBSD.org>
Fri, 2 Mar 2018 12:10:43 +0000 (13:10 +0100)
committerJean-Baptiste Kempf <jb@videolan.org>
Fri, 2 Mar 2018 15:41:05 +0000 (16:41 +0100)
The compilation failed on FreeBSD 11.1 on file
src/util/time.c:58.

The /usr/include/sys/time.h of FreeBSD contains:
int getitimer(int, struct itimerval *);
int gettimeofday(struct timeval *, struct timezone *);

Signed-off-by: Jean-Baptiste Kempf <jb@videolan.org>
configure.ac

index e5fba47..7343775 100644 (file)
@@ -51,6 +51,10 @@ case "${host_os}" in
     SYS=netbsd
     CFLAGS="${CFLAGS} -D_NETBSD_SOURCE"
     ;;
+  freebsd*)
+    SYS=freebsd
+    CFLAGS="${CFLAGS} -D_XOPEN_SOURCE=700"
+    ;;
   *)
     SYS="${host_os}"
     ;;