Only do the _POSIX_C_SOURCE hackery on linux where it's required.

On other OSes, the nasty hack was resulting in prototypes being hidden, so just
don't do it.
This commit is contained in:
Eric Anholt 2006-12-08 13:35:36 -08:00
parent 228b9f7769
commit d442998e39

View File

@ -53,12 +53,11 @@ OR PERFORMANCE OF THIS SOFTWARE.
#include <dix-config.h>
#endif
#ifndef __linux__
#include <time.h>
#else
/* The world's most shocking hack, to ensure we get clock_gettime() and
* CLOCK_MONOTONIC. */
#ifdef sun /* Needed to tell Solaris headers not to restrict to */
#define __EXTENSIONS__ /* only the functions defined in POSIX 199309. */
#endif
#ifdef _POSIX_C_SOURCE
#define _SAVED_POSIX_C_SOURCE _POSIX_C_SOURCE
#undef _POSIX_C_SOURCE
@ -69,6 +68,7 @@ OR PERFORMANCE OF THIS SOFTWARE.
#ifdef _SAVED_POSIX_C_SOURCE
#define _POSIX_C_SOURCE _SAVED_POSIX_C_SOURCE
#endif
#endif /* __linux__ */
#ifdef __CYGWIN__
#include <stdlib.h>