Commit a56b0dde authored by Eric S. Raymond's avatar Eric S. Raymond

On NetBSD, <sys/timex.h> has <sys/time.h> as a prerequisite header.

parent 54f1a686
......@@ -61,6 +61,10 @@ Parts of this code are a thicket of C preprocessor conditionals.
In an attempt to make these halfway comprehensible, we use the
following conventions to distinguish classes of macro names:
ENABLE_*::
Gates the code for an optional feature. Set by a switch on
the "waf configure" invocation.
GUARD_*::
Symbols with thie GUARD_ prefix are idempotency guards - that is,
they're used to nullify inclusions of a header file
......@@ -83,15 +87,16 @@ NEED_*::
function, but instead have to be probed for by some ad-hoc
test in waf configure.
OVERRIDE_*::
Override a default for debugging purposes. These are values
(buffer lengths and the like) which waf is not expected to
normally override but which might need to be forced.
USE_*::
Use symbols are set internally within other conditionals to
gate use of sections of code that must be conditionally
compiled deoending on *combinations* of HAVE and NEED symbols.
FEATURE_*::
Gates the code for an optional feature. Set by a switch on
the "waf configure" invocation.
=== Cross-platform portability ===
Do not bake in any assumptions about 32-vs-64-bit word size. It is OK
......
......@@ -7,6 +7,7 @@
#define GUARD_NTP_SYSCALL_H
#ifdef HAVE_SYS_TIMEX_H
# include <sys/time.h> /* prerequisite on NetBSD */
# include <sys/timex.h>
#endif
......
......@@ -54,12 +54,12 @@ move_fd(
)
{
#if !defined(SYS_WINNT) && defined(F_DUPFD)
#ifndef FD_CHUNK
#ifdef OVERRIDE_FD_CHUNK
#define FD_CHUNK OVERRIDE_FD_CHUNK
#else
#define FD_CHUNK 10
#endif
#ifndef FOPEN_MAX
#define FOPEN_MAX 20
#endif
/*
* number of fds we would like to have for
* stdio FILE* available.
......@@ -69,7 +69,9 @@ move_fd(
* we don't keep the other FILE* open beyond the
* scope of the function that opened it.
*/
#ifndef FD_PREFERRED_SOCKBOUNDARY
#ifdef OVERRIDE_FD_PREFERRED_SOCKBOUNDARY
#define FD_PREFERRED_SOCKBOUNDARY OVERRIDE_FD_PREFERRED_SOCKBOUNDARY
#else
#define FD_PREFERRED_SOCKBOUNDARY 48
#endif
......
......@@ -28,7 +28,9 @@
#define WORKITEMS_ALLOC_INC 16
#define RESPONSES_ALLOC_INC 4
#ifndef THREAD_MINSTACKSIZE
#ifdef OVERRIDE_THREAD_MINSTACKSIZE
#define THREAD_MINSTACKSIZE OVERRIDE_THREAD_MINSTACKSIZE
#else
#define THREAD_MINSTACKSIZE (64U * 1024)
#endif
......
......@@ -99,24 +99,24 @@ nic_rule *nic_rule_list;
#if defined(SO_BINTIME) && defined(SCM_BINTIME) && defined(CMSG_FIRSTHDR)
# define USE_PACKET_TIMESTAMP
# define USE_SCM_BINTIME
# ifdef BINTIME_CTLMSGBUF_SIZE
# define CMSG_BUFSIZE BINTIME_CTLMSGBUF_SIZE
# ifdef OVERRIDE_BINTIME_CTLMSGBUF_SIZE
# define CMSG_BUFSIZE OVERRIDE_BINTIME_CTLMSGBUF_SIZE
# else
# define CMSG_BUFSIZE 1536 /* moderate default */
# endif
#elif defined(SO_TIMESTAMPNS) && defined(SCM_TIMESTAMPNS) && defined(CMSG_FIRSTHDR)
# define USE_PACKET_TIMESTAMP
# define USE_SCM_TIMESTAMPNS
# ifdef TIMESTAMPNS_CTLMSGBUF_SIZE
# define CMSG_BUFSIZE TIMESTAMPNS_CTLMSGBUF_SIZE
# ifdef OVERRIDE_TIMESTAMPNS_CTLMSGBUF_SIZE
# define CMSG_BUFSIZE OVERRIDE_TIMESTAMPNS_CTLMSGBUF_SIZE
# else
# define CMSG_BUFSIZE 1536 /* moderate default */
# endif
#elif defined(SO_TIMESTAMP) && defined(SCM_TIMESTAMP) && defined(CMSG_FIRSTHDR)
# define USE_PACKET_TIMESTAMP
# define USE_SCM_TIMESTAMP
# ifdef TIMESTAMP_CTLMSGBUF_SIZE
# define CMSG_BUFSIZE TIMESTAMP_CTLMSGBUF_SIZE
# ifdef OVERRIDE_TIMESTAMP_CTLMSGBUF_SIZE
# define CMSG_BUFSIZE OVERRIDE_TIMESTAMP_CTLMSGBUF_SIZE
# else
# define CMSG_BUFSIZE 1536 /* moderate default */
# endif
......
......@@ -12,6 +12,7 @@
#include <sys/time.h>
#ifdef HAVE_SYS_TIMEX_H
# include <sys/time.h> /* prerequisite on NetBSD */
# include "sys/timex.h"
#endif
......
......@@ -17,6 +17,7 @@
#ifndef HAVE_ADJTIMEX
#error This program requires the adjtimex(2) system call.
#else
# include <sys/time.h> /* prerequisite on NetBSD */
# include <sys/timex.h>
static struct timex txc;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment