-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathosname.h
386 lines (323 loc) · 9.06 KB
/
osname.h
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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
#ifndef OSNAME_H
#define OSNAME_H 1
/* C-Ware License
*
* Copyright (c) 2022, C-Ware
* All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this
* list of conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice,
* this list of conditions and the following disclaimer in the documentation
* and/or other materials provided with the distribution.
*
* 3. Redistributions of modified source code must append a copyright notice in
* the form of 'Copyright <YEAR> <NAME>' to each modified source file's
* copyright notice, and the standalone license file if one exists.
*
* A "redistribution" can be constituted as any version of the source code
* that is intended to comprise some other derivative work of this code. A
* fork created for the purpose of contributing to any version of the source
* does not constitute a truly "derivative work" and does not require listing.
*
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
* AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
/* This enum stores a "best-approximation" OS list */
#define OS_UNIX 1 /* UNIX and UNIX-like systems, including POSIX compatibility layers */
#define OS_WINDOWS 2 /* Microsoft Windows and its successors, including Win16/3.1 */
#define OS_DOS 3 /* Microsoft MS-DOS, IBM PC-DOS DRA DR-DOS */
#define OS_OS2 4 /* IBM OS/2 2.x */
#define OS_S370 5 /* IBM MVS/370, MVS/SP, MVS/XA, MVS/ESA, OS/390, z/OS, VM/370, VM/SP, VM/ESA, z/VM, VSE/ESA, z/VSE, VSEn */
#define OS_DEC 6 /* DEC RSX-11, (Open)VMS, RSTS/E, TOPS-10, TOPS-20 */
#define OS_MACINTOSH 7 /* Classic Mac OS (OS X is considered to be a UNIX) */
#define OS_AMIGA 8 /* AmigaOS (<4 and 4), MorphOS, AROS */
#define OS_OTHER 9 /* Placeholder for systems with either partial POSIX compatiblity or is of a class not listed above */
#ifdef _AIX
# define OSNAME "AIX"
# define OSCLASS OS_UNIX
#endif
#ifdef __ANDROID__
# define OSNAME "Android"
# define OSCLASS OS_UNIX
#endif
#ifdef UTS
# define OSNAME "UTS"
# define OSCLASS OS_UNIX
#endif
#ifdef aegis
# define OSNAME "Aegis"
# define OSCLASS OS_UNIX
#endif
#ifdef __BEOS__
# define OSNAME "BeOS"
# define OSCLASS OS_OTHER
#endif
#ifdef __FreeBSD__
# define OSNAME "FreeBSD"
# define OSCLASS OS_UNIX
#endif
#ifdef __NetBSD__
# define OSNAME "NetBSD"
# define OSCLASS OS_UNIX
#endif
#ifdef __OpenBSD__
# define OSNAME "OpenBSD"
# define OSCLASS OS_UNIX
#endif
#ifdef __bsdi__
# define OSNAME "BSD/OS"
# define OSCLASS OS_UNIX
#endif
#ifdef __DragonFly__
# define OSNAME "DragonFly BSD"
# define OSCLASS OS_UNIX
#endif
#ifdef __convex__
# define OSNAME "ConvexOS"
# define OSCLASS OS_UNIX
#endif
#ifdef __CYGWIN__
# define OSNAME "Windows NT (Cygwin)"
# define OSCLASS OS_UNIX
#endif
#if defined __DGUX__ || DGUX
# define OSNAME "DG/UX"
# define OSCLASS OS_UNIX
#endif
#if defined __SEQUENT__ || sequent
# define OSNAME "DYNIX/ptx"
# define OSCLASS OS_UNIX
#endif
#ifdef __ECOS
# define OSNAME "eCos"
# define OSCLASS OS_OTHER
#endif
#ifdef __EMX__
# define OSNAME "OS/2 (EMX)"
# define OSCLASS OS_UNIX
#endif
#ifdef __gnu_hurd__
# define OSNAME "GNU/Hurd"
# define OSCLASS OS_UNIX
#endif
#if defined __gnu_linux__ || defined __linux__ || defined linux
# define OSNAME "GNU/Linux"
# define OSCLASS OS_UNIX
#endif
#if defined _hpux || defined hpux || defined __hpux
# define OSNAME "HP-UX"
# define OSCLASS OS_UNIX
#endif
#ifdef __OS400__
# define OSNAME "OS/400"
# define OSCLASS OS_OTHER
#endif
#if defined __sgi || defined sgi
# define OSNAME "IRIX"
# define OSCLASS OS_UNIX
#endif
#ifdef __INTEGRITY
# define OSNAME "INTEGRITY"
# define OSCLASS OS_OTHER
#endif
#ifdef __Lynx__
# define OSNAME "LynxOS"
# define OSCLASS OS_OTHER
#endif
#if defined macintosh || defined Macintosh
# define OSNAME "Classic Mac OS"
# define OSTYPE MACINTOSH
#endif
#ifdef __APPLE__
# ifdef __MACH
# define OSNAME "Mac OS X"
# define OSCLASS OS_UNIX
# endif
#endif
#if defined __OS9000 || defined _OSK
# define OSNAME "OS-9"
# define OSCLASS OS_OTHER
#endif
#ifdef __MORPHOS__
# define OSNAME "MorphOS"
# define OSCLASS OS_AMIGA
#endif
#ifdef __AROS__
# define OSNAME "AROS"
# define OSCLASS OS_AMIGA
#endif
#if defined AMIGA || defined __amigaos__
# define OSNAME "AmigaOS"
# define OSCLASS OS_AMIGA
#endif
#if defined mpeix || defined __mpexl
# define OSNAME "MPE/iX"
# define OSCLASS OS_OTHER
#endif
#if defined MSDOS || defined __MSDOS__ || defined _MSDOS || defined __DOS__
# define OSNAME "MS-DOS"
# define OSCLASS OS_DOS
#endif
#ifdef __TANDEM
# define OSNAME "NonStop OS"
# define OSCLASS OS_OTHER
#endif
#if defined OS2 || defined _OS2 || defined __OS2__ || defined __TOS_OS2__
# define OSNAME "OS/2"
# define OSCLASS OS_OS2
#endif
#ifdef EPLAN9
# define OSNAME "Plan 9"
# define OSCLASS OS_OTHER
#endif
#if defined __QNX__ || defined __QNXNTO__
# define OSNAME "QNX"
# define OSCLASS OS_UNIX
#endif
#if defined sun || defined __sun
# if defined __SVR4 || defined __svr4
# define OSNAME "Solaris"
# define OSCLASS OS_UNIX
# else
# define OSNAME "SunOS"
# define OSCLASS OS_UNIX
# endif
#endif
#ifdef __VOS__
# define OSNAME "VOS"
# define OSCLASS OS_OTHER
#endif
#if defined __osf__ || defined __osf
# define OSNAME "OSF/1"
# define OSCLASS OS_UNIX
#endif
#if defined ultrix || defined __ultrix || defined __ultrix__ || defined __SYSTYPE_BSD || defined __ULTRIX__
# define OSNAME "ULTRIX"
# define OSCLASS OS_UNIX
#endif
#if defined sco
# if defined _UNIXWARE7
# define OSNAME "UnixWare"
# define OSCLASS OS_UNIX
# else
# define OSNAME "OpenServer"
# define OSCLASS OS_UNIX
# endif
#endif
#if defined VMS || defined __VMS
# define OSNAME "VMS"
# define OSCLASS OS_VMS
#endif
#ifdef __VM__
# define OSNAME "VM/CMS"
# define OSCLASS OS_S370
#endif
#ifdef __MVS__
# define OSNAME "MVS"
# define OSCLASS OS_S370
#endif
#ifdef __EDC_LE
# ifndef __VM__
# define OSNAME "VSE"
# define OSCLASS OS_S370
# endif
# ifndef __MVS__
# define OSNAME "VSE"
# define OSCLASS OS_S370
# endif
#endif
#if defined __MCP__
# define OSNAME "MCP"
# define OSCLASS OS_OTHER
#endif
#if defined _NETWARE_ || defined __NETWARE__
# define OSNAME "NetWare"
# define OSCLASS OS_OTHER
#endif
#ifdef __MACH__
# ifndef __APPLE__
# define OSNAME "NeXTSTEP"
# define OSCLASS OS_UNIX
# endif
#endif
#ifdef pyr
# define OSNAME "DC/OSx"
# define OSCLASS OS_UNIX
#endif
#if defined sinux || defined sinix
# define OSNAME "Reliant UNIX"
# define OSCLASS OS_UNIX
#endif
#ifdef _UNICOS
# define OSNAME "UNICOS"
# define OSCLASS OS_UNIX
#endif
#if defined _CRAY || defined _crayx1
# define OSNAME "UNICOS/mp"
# define OSCLASS OS_UNIX
#endif
#ifdef _UWIN
# define OSNAME "Windows NT (U/Win)"
# define OSCLASS OS_WINDOWS
#endif
#if defined __VXWORKS__ || defined __vxworks
# define OSNAME "VxWorks"
# define OSCLASS OS_OTHER
#endif
#ifdef _WIN32_WCE
# define OSNAME "Windows CE"
# define OSCLASS OS_WINDOWS
#endif
/* Double-test to weed out NT POSIX subsystem */
#if defined _WIN32 || defined _WIN64 || defined __WIN32__
# ifndef _POSIX
# define OSNAME "Windows NT"
# define OSCLASS OS_WINDOWS
# endif
#endif
#if defined _WIN32
# if defined _POSIX
# define OSNAME "Windows NT (POSIX subsystem)"
# define OSCLASS OS_WINDOWS
# endif
#endif
#ifdef _WIN16
# define OSNAME "Windows 3.x"
# define OSCLASS OS_WINDOWS
#endif
/* This tests for 4.x BSD */
#ifndef OSNAME
# ifdef unix
# include <sys/param.h>
# ifdef BSD4_2
# define OSNAME "4.2 BSD"
# define OSCLASS OS_UNIX
# endif
# ifdef BSD4_3
# define OSNAME "4.3 BSD"
# define OSCLASS OS_UNIX
# endif
# ifdef BSD4_4
# define OSNAME "4.4 BSD"
# define OSCLASS OS_UNIX
# endif
# ifdef _SCO_NAMELEN
# define OSNAME "SCO OpenServer/UnixWare"
# define OSCLASS OS_UNIX
# endif
# endif
#endif
#endif