summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDaniel Mack <zonque@gmail.com>2011-04-22 02:27:35 +0200
committerColin Guthrie <colin@mageia.org>2011-04-23 18:23:37 +0100
commit98f2209663596ec7d022af2aa8328ef224f2b80b (patch)
treed8a4b6d6827c97f5737ff7b0ea12262a52b1a7c1
parent7a3b3a376308df191b19b73fe8dbe97659a1061a (diff)
pulsecore:: Define _POSIX_C_SOURCE locally for rtclock on OSX
Defining this macro on a global level is disadvantageous for other APIs, and as we need it for clock_gettime() only on Mac OS X, define it locally in pulsecore/core-rtclock.c only.
-rw-r--r--configure.ac1
-rw-r--r--src/pulsecore/core-rtclock.c4
2 files changed, 4 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index 5b41bb47..e2b5a6aa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,7 +89,6 @@ case $host in
AC_DEFINE(__EXTENSIONS__, 1, Needed to get declarations for msg_control and msg_controllen on Solaris)
;;
*-*-darwin* )
- AC_DEFINE([_POSIX_C_SOURCE], [200112L], [Needed to get clock_gettime on Mac OS X])
AC_DEFINE([_DARWIN_C_SOURCE], [200112L], [Needed to get NSIG on Mac OS X])
;;
esac
diff --git a/src/pulsecore/core-rtclock.c b/src/pulsecore/core-rtclock.c
index 331ac112..6632cc6d 100644
--- a/src/pulsecore/core-rtclock.c
+++ b/src/pulsecore/core-rtclock.c
@@ -24,6 +24,10 @@
#include <config.h>
#endif
+#ifdef OS_IS_DARWIN
+#define _POSIX_C_SOURCE 1
+#endif
+
#include <stddef.h>
#include <time.h>
#include <sys/time.h>