Make more (and better) use of feature test macros; suggested by Matthias

Drochner.
This commit is contained in:
kleink 2006-03-29 21:57:07 +00:00
parent 3f6e548563
commit b02d297c2d
1 changed files with 14 additions and 9 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: time.h,v 1.53 2006/03/17 08:50:36 kleink Exp $ */
/* $NetBSD: time.h,v 1.54 2006/03/29 21:57:07 kleink Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
@ -59,6 +59,7 @@ struct timespec {
long tv_nsec; /* and nanoseconds */
};
#if defined(_NETBSD_SOURCE)
#define TIMEVAL_TO_TIMESPEC(tv, ts) do { \
(ts)->tv_sec = (tv)->tv_sec; \
(ts)->tv_nsec = (tv)->tv_usec * 1000; \
@ -128,6 +129,7 @@ struct timezone {
(vsp)->tv_nsec += 1000000000L; \
} \
} while (/* CONSTCOND */ 0)
#endif /* _NETBSD_SOURCE */
/*
* Names of the interval timers, and structure
@ -225,24 +227,27 @@ void realtimerexpire(void *);
#include <sys/select.h>
#endif
#include <sys/cdefs.h>
#include <time.h>
#if defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
#include <sys/cdefs.h>
__BEGIN_DECLS
int adjtime(const struct timeval *, struct timeval *);
int futimes(int, const struct timeval [2]);
#if (_POSIX_C_SOURCE - 0) >= 200112L || \
defined(_XOPEN_SOURCE) || defined(_NETBSD_SOURCE)
int getitimer(int, struct itimerval *);
int gettimeofday(struct timeval * __restrict, void * __restrict);
int lutimes(const char *, const struct timeval [2]);
int setitimer(int, const struct itimerval * __restrict,
struct itimerval * __restrict);
int utimes(const char *, const struct timeval [2]);
#endif /* _POSIX_C_SOURCE >= 200112L || _XOPEN_SOURCE || _NETBSD_SOURCE */
#if defined(_NETBSD_SOURCE)
int adjtime(const struct timeval *, struct timeval *);
int futimes(int, const struct timeval [2]);
int lutimes(const char *, const struct timeval [2]);
int settimeofday(const struct timeval * __restrict,
const void * __restrict);
int utimes(const char *, const struct timeval [2]);
#endif /* _NETBSD_SOURCE */
__END_DECLS
#endif /* _XOPEN_SOURCE || _NETBSD_SOURCE */
#endif /* !_STANDALONE */