cpp: Use #pragma once instead of #ifndef guards
[ghc.git] / utils / lndir / lndir-Xos.h
1 /*
2 * $XConsortium: Xos.h,v 1.47 91/08/17 17:14:38 rws Exp $
3 *
4 * Copyright 1987 by the Massachusetts Institute of Technology
5 *
6 * Permission to use, copy, modify, and distribute this software and its
7 * documentation for any purpose and without fee is hereby granted, provided
8 * that the above copyright notice appear in all copies and that both that
9 * copyright notice and this permission notice appear in supporting
10 * documentation, and that the name of M.I.T. not be used in advertising
11 * or publicity pertaining to distribution of the software without specific,
12 * written prior permission. M.I.T. makes no representations about the
13 * suitability of this software for any purpose. It is provided "as is"
14 * without express or implied warranty.
15 *
16 * The X Window System is a Trademark of MIT.
17 *
18 */
19
20 /* This is a collection of things to try and minimize system dependencies
21 * in a "signficant" number of source files.
22 */
23
24 #pragma once
25
26 #include "lndir-Xosdefs.h"
27
28 /*
29 * Get major data types (esp. caddr_t)
30 */
31
32 #ifdef USG
33 #ifndef __TYPES__
34 #ifdef CRAY
35 #define word word_t
36 #endif /* CRAY */
37 #include <sys/types.h> /* forgot to protect it... */
38 #define __TYPES__
39 #endif /* __TYPES__ */
40 #else /* USG */
41 #if defined(_POSIX_SOURCE) && defined(MOTOROLA)
42 #undef _POSIX_SOURCE
43 #include <sys/types.h>
44 #define _POSIX_SOURCE
45 #else
46 #include <sys/types.h>
47 #endif
48 #endif /* USG */
49
50
51 /*
52 * Just about everyone needs the strings routines. We provide both forms here,
53 * index/rindex and strchr/strrchr, so any systems that don't provide them all
54 * need to have #defines here.
55 */
56
57 #ifndef X_NOT_STDC_ENV
58 #include <string.h>
59 #define index strchr
60 #define rindex strrchr
61 #else
62 #ifdef SYSV
63 #include <string.h>
64 #define index strchr
65 #define rindex strrchr
66 #else
67 #include <strings.h>
68 #define strchr index
69 #define strrchr rindex
70 #endif
71 #endif
72
73
74 /*
75 * Get open(2) constants
76 */
77 #ifdef X_NOT_POSIX
78 #include <fcntl.h>
79 #ifdef USL
80 #include <unistd.h>
81 #endif /* USL */
82 #ifdef CRAY
83 #include <unistd.h>
84 #endif /* CRAY */
85 #ifdef MOTOROLA
86 #include <unistd.h>
87 #endif /* MOTOROLA */
88 #ifdef SYSV386
89 #include <unistd.h>
90 #endif /* SYSV386 */
91 #include <sys/file.h>
92 #else /* X_NOT_POSIX */
93 #if !defined(_POSIX_SOURCE) && defined(macII)
94 #define _POSIX_SOURCE
95 #include <fcntl.h>
96 #undef _POSIX_SOURCE
97 #else
98 #include <fcntl.h>
99 #endif
100 #include <unistd.h>
101 #endif /* X_NOT_POSIX else */
102
103 /*
104 * Get struct timeval
105 */
106
107 #ifdef SYSV
108
109 #ifndef USL
110 #include <sys/time.h>
111 #endif
112 #include <time.h>
113 #ifdef CRAY
114 #undef word
115 #endif /* CRAY */
116 #if defined(USG) && !defined(CRAY) && !defined(MOTOROLA)
117 struct timeval {
118 long tv_sec;
119 long tv_usec;
120 };
121 #ifndef USL_SHARELIB
122 struct timezone {
123 int tz_minuteswest;
124 int tz_dsttime;
125 };
126 #endif /* USL_SHARELIB */
127 #endif /* USG */
128
129 #else /* not SYSV */
130
131 #if defined(_POSIX_SOURCE) && defined(SVR4)
132 /* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */
133 #undef _POSIX_SOURCE
134 #include <sys/time.h>
135 #define _POSIX_SOURCE
136 #else
137 #include <sys/time.h>
138 #endif
139
140 #endif /* SYSV */
141
142 /* use POSIX name for signal */
143 #if defined(X_NOT_POSIX) && defined(SYSV) && !defined(SIGCHLD)
144 #define SIGCHLD SIGCLD
145 #endif
146
147 #ifdef ISC
148 #include <sys/bsdtypes.h>
149 #endif