From: Uwe Hermann Date: Sat, 29 Aug 2015 12:50:44 +0000 (+0200) Subject: Don't set _POSIX_C_SOURCE for VXI/RPC related files. X-Git-Tag: libsigrok-0.4.0~372 X-Git-Url: https://sigrok.org/gitaction?a=commitdiff_plain;h=d40b8557a962;p=libsigrok.git Don't set _POSIX_C_SOURCE for VXI/RPC related files. Make vxi.h the first #include in all affected files and #undef the _POSIX_C_SOURCE macro in vxi.h. This avoids various build issues on e.g. FreeBSD or Mac OS X where setting _POSIX_C_SOURCE leads to the unavailability of certain types such as u_long (as used in the VXI/RPC code). --- diff --git a/src/scpi/scpi_vxi.c b/src/scpi/scpi_vxi.c index e28a77a3..b2324b71 100644 --- a/src/scpi/scpi_vxi.c +++ b/src/scpi/scpi_vxi.c @@ -20,9 +20,9 @@ * along with this program. If not, see . */ +#include "vxi.h" #include #include -#include "vxi.h" #include #include "libsigrok-internal.h" #include "scpi.h" diff --git a/src/scpi/vxi.h b/src/scpi/vxi.h index 61a51f62..59ec4df3 100644 --- a/src/scpi/vxi.h +++ b/src/scpi/vxi.h @@ -3,6 +3,8 @@ * It was generated using rpcgen. */ +#undef _POSIX_C_SOURCE + #ifndef _VXI_H_RPCGEN #define _VXI_H_RPCGEN diff --git a/src/scpi/vxi_clnt.c b/src/scpi/vxi_clnt.c index 55a72dc2..313bfd7f 100644 --- a/src/scpi/vxi_clnt.c +++ b/src/scpi/vxi_clnt.c @@ -3,8 +3,8 @@ * It was generated using rpcgen. */ -#include /* for memset */ #include "vxi.h" +#include /* for memset */ /* Default timeout can be changed using clnt_control() */ static struct timeval TIMEOUT = { 25, 0 };