From 1e3f6c8bc2fd9d75e19e79305802e389919f6f4a Mon Sep 17 00:00:00 2001 From: TLINDEN Date: Sat, 20 Dec 2014 20:10:08 +0100 Subject: [PATCH] yet another try to fix #4, now tested on another linux system --- include/pcp.h | 16 ++++++++++++++++ include/pcp/mgmt.h | 16 ++++++++++++++++ src/pcp.h | 6 ------ 3 files changed, 32 insertions(+), 6 deletions(-) diff --git a/include/pcp.h b/include/pcp.h index b9881a9..0d7b910 100644 --- a/include/pcp.h +++ b/include/pcp.h @@ -5,6 +5,22 @@ extern "C" { #endif +#if defined __linux__ || defined __GNU__ || defined __GLIBC__ +# ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE 1 +# endif +# +# ifndef _XOPEN_SOURCE +# define _XOPEN_SOURCE 1 +# endif +# +# ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +# endif +#else +# define _BSD_SOURCE 1 +#endif + #include "pcp/config.h" #include "pcp/base85.h" #include "pcp/buffer.h" diff --git a/include/pcp/mgmt.h b/include/pcp/mgmt.h index ebd069b..21b2978 100644 --- a/include/pcp/mgmt.h +++ b/include/pcp/mgmt.h @@ -26,6 +26,22 @@ #ifndef _HAVE_PCP_MGMT_H #define _HAVE_PCP_MGMT_H +#if defined __linux__ || defined __GNU__ || defined __GLIBC__ +# ifndef _DEFAULT_SOURCE +# define _DEFAULT_SOURCE 1 +# endif +# +# ifndef _XOPEN_SOURCE +# define _XOPEN_SOURCE 1 +# endif +# +# ifndef _GNU_SOURCE +# define _GNU_SOURCE 1 +# endif +#else +# define _BSD_SOURCE 1 +#endif + #include #include #include diff --git a/src/pcp.h b/src/pcp.h index 5344671..e5bb9f8 100644 --- a/src/pcp.h +++ b/src/pcp.h @@ -23,12 +23,6 @@ #ifndef _HAVE_PCP_H #define _HAVE_PCP_H -#if defined __linux__ || defined __GNU__ || defined __GLIBC__ -#define _DEFAULT_SOURCE 1 -#else -#define _BSD_SOURCE 1 -#endif - #include #include #include