summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTilghman Lesher <tilghman@meg.abyt.es>2009-08-30 18:37:17 +0000
committerTilghman Lesher <tilghman@meg.abyt.es>2009-08-30 18:37:17 +0000
commit9f7a3466efa1bac3a881ffbb5b6cbce5cff404b3 (patch)
tree6695388511a822262609807eb879d05e767b35fb
parent01fd08d5b9a3fba0975bbe3c0eec83c9e5ea684f (diff)
Various patches, to enable Asterisk to once again compile on Mac OS X.
One note on defining _POSIX_C_SOURCE: while this feature test macro works to require certain behaviors on Linux, it works differently on *BSD platforms to REMOVE certain API calls that are not in the POSIX specification, such as vasprintf(3). Thus, defining it while depending upon vasprintf (and other extensions to the POSIX standard) to be defined is a recipe to ensure that Asterisk is only buildable on Linux. Hence, this define which was meant to INCREASE portability, effectively ensures the opposite. git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@214863 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--include/asterisk.h4
-rw-r--r--main/poll.c4
2 files changed, 8 insertions, 0 deletions
diff --git a/include/asterisk.h b/include/asterisk.h
index 049490bc9..c62cb726b 100644
--- a/include/asterisk.h
+++ b/include/asterisk.h
@@ -20,6 +20,8 @@
#include "asterisk/autoconfig.h"
+#ifndef __Darwin__
+
#define _POSIX_C_SOURCE 200112L
#define _XOPEN_SOURCE 600
@@ -35,6 +37,8 @@
#endif
*/
+#endif /* __Darwin__ */
+
#if !defined(NO_MALLOC_DEBUG) && !defined(STANDALONE) && defined(MALLOC_DEBUG)
#include "asterisk/astmm.h"
#endif
diff --git a/main/poll.c b/main/poll.c
index 62e681dca..fb0ccb2ac 100644
--- a/main/poll.c
+++ b/main/poll.c
@@ -83,6 +83,10 @@
#ifdef AST_POLL_COMPAT
+#ifndef MAX
+#define MAX(a,b) a > b ? a : b
+#endif
+
/*---------------------------------------------------------------------------*\
Private Functions
\*---------------------------------------------------------------------------*/