File: hstdinc.h

package info (click to toggle)
hercules 3.07-2.3
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 14,536 kB
  • ctags: 18,225
  • sloc: ansic: 162,921; sh: 8,522; makefile: 784; perl: 202; sed: 16
file content (246 lines) | stat: -rw-r--r-- 5,883 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
/* HSTDINC.H    (c) Copyright Roger Bowler, 1999-2009                */
/*              Hercules precompilation-eligible Header Files        */

/* This file contains #include statements for all of the header      */
/* files which are not dependent on the mainframe architectural      */
/* features selected and thus are eligible for precompilation        */

// $Id: hstdinc.h 5497 2009-10-27 20:17:03Z fish $

#ifndef _HSTDINC_H
#define _HSTDINC_H

#ifdef HAVE_CONFIG_H
  #include <config.h> // Hercules build configuration options/settings
#endif

///////////////////////////////////////////////////////////////////////
// Required and optional SYSTEM headers...
//////////////////////////////////////////////////////////////////////

#define _REENTRANT    /* Ensure that reentrant code is generated *JJ */
#define _THREAD_SAFE            /* Some systems use this instead *JJ */

#if defined(HAVE_STRSIGNAL) && defined(__GNUC__) && !defined(_GNU_SOURCE)
  #define _GNU_SOURCE                 /* required by strsignal() *JJ */
#endif

/* Required headers  --  These we ALWAYS need to have... */

#ifdef _MSVC_
  // The following ensures certain functions get defined...
  // (such as TryEnterCriticalSection and InitializeCriticalSectionAndSpinCount)
  #ifndef _WIN32_WINNT
    #define _WIN32_WINNT 0x0403  // Windows 98 or WinNT SP4 or greater
  #endif
  #include <winsock2.h>         // Windows Sockets 2
  #include <mstcpip.h>          // (need struct tcp_keepalive)
#endif
#ifdef WIN32
  #include <windows.h>
#endif
#ifdef _MSVC_
  #include <tchar.h>
  #include <wincon.h>
  #include <conio.h>
  #include <io.h>
  #include <lmcons.h>
  #include <tlhelp32.h>
  #include <dbghelp.h>
  #include <crtdbg.h>
#endif

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <string.h>
#include <setjmp.h>
#include <ctype.h>
#include <errno.h>
#include <fcntl.h>
#ifndef O_BINARY
#define O_BINARY 0
#endif
#ifndef O_NONBLOCK
#define O_NONBLOCK 0
#endif
#include <limits.h>
#include <time.h>
#include <sys/stat.h>
#if !defined(_MSVC_)
  #include <sys/time.h>
  #include <sys/ioctl.h>
#endif
#include <sys/types.h>

/* Optional headers  --  These we can live without */

/* PROGRAMMING NOTE: On Darwin, <sys/socket.h> must be included before
   <net/if.h>, and on older Darwin systems, before <net/route.h> and
   <netinet/in.h> */
#ifdef HAVE_SYS_SOCKET_H
  #include <sys/socket.h>
#endif
#ifdef HAVE_ARPA_INET_H
  #include <arpa/inet.h>
#endif
#if defined(BUILD_HERCIFC)
  #ifdef HAVE_LINUX_IF_TUN_H
    #include <linux/if_tun.h>
  #endif
  #ifdef HAVE_NET_ROUTE_H
    #include <net/route.h>
  #endif
#endif
// (just make it easier to #include hercifc.h)
#if defined(BUILD_HERCIFC) || defined(_MSVC_) || !defined(HAVE_LINUX_IF_TUN_H) || !defined(HAVE_NET_IF_H)
  #define NEED_HERCIFC_H
#endif
#ifdef HAVE_NET_IF_H
  #include <net/if.h>
#endif
#ifdef HAVE_NETINET_IN_H
  #include <netinet/in.h>
#endif
#ifdef HAVE_NETINET_TCP_H
  #include <netinet/tcp.h>
#endif
#ifdef HAVE_SYS_IOCTL_H
  #include <sys/ioctl.h>
#endif
#ifdef HAVE_SYS_MMAN_H
  #include <sys/mman.h>
#endif
#ifdef HAVE_SYS_PARAM_H
  #include <sys/param.h>
#endif
#ifdef HAVE_SYS_MOUNT_H
  #include <sys/mount.h>
#endif
#ifdef HAVE_SYS_MTIO_H
  #include <sys/mtio.h>
#endif
#ifdef HAVE_SYS_RESOURCE_H
  #include <sys/resource.h>
#endif
#ifdef HAVE_SYS_UN_H
  #include <sys/un.h>
#endif
#ifdef HAVE_SYS_UIO_H
  #include <sys/uio.h>
#endif
#ifdef HAVE_SYS_UTSNAME_H
  #include <sys/utsname.h>
#endif
#ifdef HAVE_SYS_WAIT_H
  #include <sys/wait.h>
#endif
#ifdef HAVE_BYTESWAP_H
 #ifndef NO_ASM_BYTESWAP
  #include <byteswap.h>
 #endif
#endif
#ifdef HAVE_BZLIB_H
  // windows.h #defines 'small' as char and bzlib.h
  // uses it for a variable name so we must #undef.
  #if defined(__CYGWIN__)
    #undef small
  #endif
  #include <bzlib.h>
  /* ISW 20050427 : CCKD_BZIP2/HET_BZIP2 are usually */
  /* controlled by config.h (automagic). If config.h */
  /* is not present however, then define them here.  */
  #if !defined(HAVE_CONFIG_H)
    #define CCKD_BZIP2
    #define HET_BZIP2
  #endif
#endif
#ifdef HAVE_DIRENT_H
  #include <dirent.h>
#endif
#ifdef OPTION_DYNAMIC_LOAD
  #ifdef HDL_USE_LIBTOOL
    #include <ltdl.h>
  #else
    #if defined(__MINGW__) || defined(_MSVC_)
      #include "w32dl.h"
    #else
      #include <dlfcn.h>
    #endif
  #endif
#endif
#ifdef HAVE_FENV_H
  #include <fenv.h>
#endif
#ifdef HAVE_ICONV
  #include <iconv.h>
#endif
#ifdef ENABLE_NLS
  #ifdef HAVE_LOCALE_H
    #include <locale.h>
  #else
    #error ENABLE_NLS requires <locale.h>
  #endif
  #ifdef HAVE_LIBINTL_H
    #include <libintl.h>
  #else
    #error ENABLE_NLS requires <libintl.h>
  #endif
#endif
#ifdef HAVE_INTTYPES_H
  #include <inttypes.h>
#endif
#ifdef HAVE_MALLOC_H
  #include <malloc.h>
#endif
#ifdef HAVE_MATH_H
  #include <math.h>
#endif
#ifdef HAVE_NETDB_H
  #include <netdb.h>
#endif
#ifdef HAVE_PWD_H
  #include <pwd.h>
#endif
#ifdef HAVE_REGEX_H
  #include <regex.h>
#endif
#ifdef HAVE_SCHED_H
  #include <sched.h>
#endif
#ifdef HAVE_SIGNAL_H
  #include <signal.h>
#endif
#ifdef HAVE_TIME_H
  #include <time.h>
#endif
#ifdef HAVE_TERMIOS_H
  #include <termios.h>
#endif
#ifdef HAVE_ZLIB_H
  #include <zlib.h>
#endif
#ifdef HAVE_SYS_CAPABILITY_H
  #include <sys/capability.h>
#endif
#ifdef HAVE_SYS_PRCTL_H
  #include <sys/prctl.h>
#endif

// Some Hercules specific files, NOT guest arch dependent
#if defined(_MSVC_)
  #include "hercwind.h"         // Hercules definitions for Windows
#else
  #include <unistd.h>           // Unix standard definitions
#endif

#ifdef C99_FLEXIBLE_ARRAYS
  #define FLEXIBLE_ARRAY        // ("DEVBLK *memdev[];" syntax is supported)
#else
  #define FLEXIBLE_ARRAY 0      // ("DEVBLK *memdev[0];" must be used instead)
#endif

#include "hostopts.h"           // Must come before htypes.h
#include "htypes.h"             // Hercules-wide data types

#endif // _HSTDINC_H