From d40b8557a9625cccfb9bef99c77dd803bdd356e7 Mon Sep 17 00:00:00 2001 From: Uwe Hermann Date: Sat, 29 Aug 2015 14:50:44 +0200 Subject: [PATCH] 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). --- src/scpi/scpi_vxi.c | 2 +- src/scpi/vxi.h | 2 ++ src/scpi/vxi_clnt.c | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) 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 }; -- 2.30.2