From 4222e1c3674a5940ac99d1602a27811ff2321ae6 Mon Sep 17 00:00:00 2001 From: "Kevin P. Fleming" Date: Mon, 17 Aug 2009 16:25:10 +0000 Subject: Define our desires for POSIX and X/OPEN API features properly. Based on a post on the gcc-help mailing list and some subsequent reading, we can increase our portability to various platforms by directly defining the POSIX and X/OPEN API feature sets we wish to have available. This patch does that, and also includes a double-check to ensure that the system we are compiling on can actually provide the requested feature sets. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@212463 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- include/asterisk.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'include') diff --git a/include/asterisk.h b/include/asterisk.h index 30a20ee60..3a6cdc0f9 100644 --- a/include/asterisk.h +++ b/include/asterisk.h @@ -20,6 +20,18 @@ #include "asterisk/autoconfig.h" +#define _POSIX_C_SOURCE 200112L +#define _XOPEN_SOURCE 600 + +#include + +#if _POSIX_VERSION < 200112L +#error System does not support POSIX version 200112. +#endif +#if _XOPEN_VERSION < 600 +#error System does not support XOPEN version 600. +#endif + #if !defined(NO_MALLOC_DEBUG) && !defined(STANDALONE) && defined(MALLOC_DEBUG) #include "asterisk/astmm.h" #endif @@ -49,17 +61,16 @@ #include #include #include -#include #include #define open(a,...) __ast_fdleak_open(__FILE__,__LINE__,__PRETTY_FUNCTION__, a, __VA_ARGS__) -#define pipe(a) __ast_fdleak_pipe(a, __FILE__,__LINE__,__PRETTY_FUNCTION__) +#define pipe(a) __ast_fdleak_pipe(a, __FILE__,__LINE__,__PRETTY_FUNCTION__) #define socket(a,b,c) __ast_fdleak_socket(a, b, c, __FILE__,__LINE__,__PRETTY_FUNCTION__) #define close(a) __ast_fdleak_close(a) #define fopen(a,b) __ast_fdleak_fopen(a, b, __FILE__,__LINE__,__PRETTY_FUNCTION__) #define fclose(a) __ast_fdleak_fclose(a) #define dup2(a,b) __ast_fdleak_dup2(a, b, __FILE__,__LINE__,__PRETTY_FUNCTION__) -#define dup(a) __ast_fdleak_dup(a, __FILE__,__LINE__,__PRETTY_FUNCTION__) +#define dup(a) __ast_fdleak_dup(a, __FILE__,__LINE__,__PRETTY_FUNCTION__) int __ast_fdleak_open(const char *file, int line, const char *func, const char *path, int flags, ...); int __ast_fdleak_pipe(int *fds, const char *file, int line, const char *func); -- cgit v1.2.3