mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-19 03:08:45 +00:00
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
This commit is contained in:
@@ -20,6 +20,18 @@
|
||||
|
||||
#include "asterisk/autoconfig.h"
|
||||
|
||||
#define _POSIX_C_SOURCE 200112L
|
||||
#define _XOPEN_SOURCE 600
|
||||
|
||||
#include <unistd.h>
|
||||
|
||||
#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,7 +61,6 @@
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <sys/socket.h>
|
||||
#include <unistd.h>
|
||||
#include <fcntl.h>
|
||||
|
||||
#define open(a,...) __ast_fdleak_open(__FILE__,__LINE__,__PRETTY_FUNCTION__, a, __VA_ARGS__)
|
||||
|
@@ -27,9 +27,6 @@
|
||||
ASTERISK_FILE_VERSION(__FILE__, "$Revision$")
|
||||
|
||||
#if defined(HAVE_LIBXML2)
|
||||
#ifndef _POSIX_C_SOURCE /* Needed on Mac OS X */
|
||||
#define _POSIX_C_SOURCE 200112L
|
||||
#endif
|
||||
#include <libxml/parser.h>
|
||||
#include <libxml/tree.h>
|
||||
#include <libxml/xinclude.h>
|
||||
|
Reference in New Issue
Block a user