[PATCH 3/8] core-rtclock.c: define _POSIX_C_SOURCE locally

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
---
 configure.ac                 |    1 -
 src/pulsecore/core-rtclock.c |    4 ++++
 2 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/configure.ac b/configure.ac
index 5b41bb4..e2b5a6a 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 331ac11..6632cc6 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>
-- 
1.7.1




[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux