ntp_types.h revision 54359
1/*
2 *  ntp_types.h - defines how int32 and u_int32 are treated.
3 *  For 64 bit systems like the DEC Alpha, they have to be defined
4 *  as int and u_int.
5 *  For 32 bit systems, define them as long and u_long
6 */
7#include "ntp_machine.h"
8
9#ifndef _NTP_TYPES_
10#define _NTP_TYPES_
11
12/*
13 * This is another naming conflict.
14 * On NetBSD for MAC the macro "mac" is defined as 1
15 * this is fun for us as a packet structure contains an
16 * optional "mac" member - severe confusion results 8-)
17 * As we hopefully do not have to rely on that macro we
18 * just undefine that.
19 */
20#ifdef mac
21#undef mac
22#endif
23
24/*
25 * Set up for prototyping
26 */
27#ifndef P
28#if defined(__STDC__) || defined(HAVE_PROTOTYPES)
29#define	P(x)	x
30#else /* not __STDC__ and not HAVE_PROTOTYPES */
31#define P(x)	()
32#endif /* not __STDC__ and HAVE_PROTOTYPES */
33#endif /* P */
34
35/*
36 * VMS DECC (v4.1), {u_char,u_short,u_long} are only in SOCKET.H,
37 *			and u_int isn't defined anywhere
38 */
39#if defined(VMS)
40#include <socket.h>
41typedef unsigned int u_int;
42/*
43 * Note: VMS DECC has  long == int  (even on __alpha),
44 *	 so the distinction below doesn't matter
45 */
46#endif /* VMS */
47
48#if (SIZEOF_INT == 4)
49# ifndef int32
50#  define int32 int
51# endif
52# ifndef u_int32
53#  define u_int32 unsigned int
54# endif
55#else /* not sizeof(int) == 4 */
56# if (SIZEOF_LONG == 4)
57# else /* not sizeof(long) == 4 */
58#  ifndef int32
59#   define int32 long
60#  endif
61#  ifndef u_int32
62#   define u_int32 unsigned long
63#  endif
64# endif /* not sizeof(long) == 4 */
65# include "Bletch: what's 32 bits on this machine?"
66#endif /* not sizeof(int) == 4 */
67
68#endif /* _NTP_TYPES_ */
69
70