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.
This commit is contained in:
Daniel Mack 2011-04-22 02:27:35 +02:00 committed by Colin Guthrie
parent 7a3b3a3763
commit 98f2209663
2 changed files with 4 additions and 1 deletions

View file

@ -89,7 +89,6 @@ case $host in
AC_DEFINE(__EXTENSIONS__, 1, Needed to get declarations for msg_control and msg_controllen on Solaris) AC_DEFINE(__EXTENSIONS__, 1, Needed to get declarations for msg_control and msg_controllen on Solaris)
;; ;;
*-*-darwin* ) *-*-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]) AC_DEFINE([_DARWIN_C_SOURCE], [200112L], [Needed to get NSIG on Mac OS X])
;; ;;
esac esac

View file

@ -24,6 +24,10 @@
#include <config.h> #include <config.h>
#endif #endif
#ifdef OS_IS_DARWIN
#define _POSIX_C_SOURCE 1
#endif
#include <stddef.h> #include <stddef.h>
#include <time.h> #include <time.h>
#include <sys/time.h> #include <sys/time.h>