plibsys 0.0.5
pmacrosos.h
Go to the documentation of this file.
1/*
2 * The MIT License
3 *
4 * Copyright (C) 2017-2018 Alexander Saprykin <saprykin.spb@gmail.com>
5 *
6 * Permission is hereby granted, free of charge, to any person obtaining
7 * a copy of this software and associated documentation files (the
8 * 'Software'), to deal in the Software without restriction, including
9 * without limitation the rights to use, copy, modify, merge, publish,
10 * distribute, sublicense, and/or sell copies of the Software, and to
11 * permit persons to whom the Software is furnished to do so, subject to
12 * the following conditions:
13 *
14 * The above copyright notice and this permission notice shall be
15 * included in all copies or substantial portions of the Software.
16 *
17 * THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
18 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
19 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
20 * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
21 * CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
22 * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
23 * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
24 */
25
39#if !defined (PLIBSYS_H_INSIDE) && !defined (PLIBSYS_COMPILATION)
40# error "Header files shouldn't be included directly, consider using <plibsys.h> instead."
41#endif
42
43#ifndef PLIBSYS_HEADER_PMACROSOS_H
44#define PLIBSYS_HEADER_PMACROSOS_H
45
46/*
47 * List of supported operating systems (P_OS_x):
48 *
49 * DARWIN - Any Darwin based system
50 * DARWIN32 - Any 32-bit Darwin based system
51 * DARWIN64 - Any 64-bit Darwin based system
52 * BSD4 - Any BSD 4.x based system
53 * FREEBSD - FreeBSD
54 * DRAGONFLY - DragonFlyBSD
55 * NETBSD - NetBSD
56 * OPENBSD - OpenBSD
57 * AIX - IBM AIX
58 * HPUX - HP-UX
59 * TRU64 - Tru64
60 * SOLARIS - Sun (Oracle) Solaris
61 * QNX - QNX 4.x
62 * QNX6 - QNX Neutrino 6.x
63 * BB10 - BlackBerry 10
64 * SCO - SCO OpenServer 5/6
65 * UNIXWARE - UnixWare 7
66 * IRIX - SGI IRIX
67 * HAIKU - Haiku
68 * SYLLABLE - Syllable
69 * BEOS - BeOS
70 * OS2 - OS/2
71 * VMS - OpenVMS
72 * AMIGA - AmigaOS
73 * UNIX - Any UNIX BSD/SYSV based system
74 * LINUX - Linux
75 * MAC9 - Mac OS 9 (Classic)
76 * MAC - Any macOS
77 * MAC32 - 32-bit macOS
78 * MAC64 - 64-bit macOS
79 * CYGWIN - Cygwin
80 * MSYS - MSYS
81 * WIN - 32-bit Windows
82 * WIN64 - 64-bit Windows
83 * ANDROID - Android
84 */
85
296#if defined(__APPLE__) && (defined(__GNUC__) || defined(__xlC__) || defined(__xlc__))
297# define P_OS_DARWIN
298# define P_OS_BSD4
299# ifdef __LP64__
300# define P_OS_DARWIN64
301# else
302# define P_OS_DARWIN32
303# endif
304# elif defined(Macintosh) || defined(macintosh)
305# define P_OS_MAC9
306#elif defined(__MSYS__)
307# define P_OS_MSYS
308#elif defined(__CYGWIN__)
309# define P_OS_CYGWIN
310#elif defined(_WIN64) || defined(_M_X64) || defined(_M_AMD64)
311# define P_OS_WIN64
312#elif defined(__WIN32__) || defined(_WIN32) || defined(WIN32)
313# define P_OS_WIN
314#elif defined(__ANDROID__)
315# define P_OS_ANDROID
316# define P_OS_LINUX
317#elif defined(__linux) || defined(__linux__)
318# define P_OS_LINUX
319#elif defined(__FreeBSD__)
320# define P_OS_FREEBSD
321# define P_OS_BSD4
322#elif defined(__DragonFly__)
323# define P_OS_DRAGONFLY
324# define P_OS_BSD4
325#elif defined(__NetBSD__)
326# define P_OS_NETBSD
327# define P_OS_BSD4
328#elif defined(__OpenBSD__)
329# define P_OS_OPENBSD
330# define P_OS_BSD4
331#elif defined(_AIX)
332# define P_OS_AIX
333#elif defined(hpux) || defined(__hpux)
334# define P_OS_HPUX
335#elif defined(__osf__) || defined(__osf)
336# define P_OS_TRU64
337#elif defined(__sun) || defined(sun)
338# define P_OS_SOLARIS
339#elif defined(__QNXNTO__)
340# ifdef __BLACKBERRY10__
341# define P_OS_BB10
342# else
343# define P_OS_QNX6
344# endif
345#elif defined(__QNX__)
346# define P_OS_QNX
347#elif defined(_SCO_DS)
348# define P_OS_SCO
349#elif defined(__USLC__) || defined(__UNIXWARE__)
350# define P_OS_UNIXWARE
351#elif defined(__svr4__) && defined(i386)
352# define P_OS_UNIXWARE
353#elif defined(__sgi) || defined(sgi)
354# define P_OS_IRIX
355#elif defined(__HAIKU__)
356# define P_OS_HAIKU
357#elif defined(__SYLLABLE__)
358# define P_OS_SYLLABLE
359#elif defined(__BEOS__)
360# define P_OS_BEOS
361#elif defined(__OS2__)
362# define P_OS_OS2
363#elif defined(VMS) || defined(__VMS)
364# define P_OS_VMS
365#elif defined(AMIGA) || defined(__amigaos__)
366# define P_OS_AMIGA
367#endif
368
369#ifdef P_OS_WIN64
370# define P_OS_WIN
371#endif
372
373#if defined(P_OS_DARWIN)
374# define P_OS_MAC
375# if defined(P_OS_DARWIN64)
376# define P_OS_MAC64
377# elif defined(P_OS_DARWIN32)
378# define P_OS_MAC32
379# endif
380#endif
381
382#if defined(P_OS_WIN) || defined(P_OS_MAC9) || defined(P_OS_HAIKU) || \
383 defined(P_OS_BEOS) || defined(P_OS_OS2) || defined(P_OS_VMS) || \
384 defined(P_OS_AMIGA)
385# undef P_OS_UNIX
386#elif !defined(P_OS_UNIX)
387# define P_OS_UNIX
388#endif
389
390/* We need this to generate full Doxygen documentation */
391
392#ifdef DOXYGEN
393# ifndef P_OS_DARWIN
394# define P_OS_DARWIN
395# endif
396# ifndef P_OS_DARWIN32
397# define P_OS_DARWIN32
398# endif
399# ifndef P_OS_DARWIN64
400# define P_OS_DARWIN64
401# endif
402# ifndef P_OS_BSD4
403# define P_OS_BSD4
404# endif
405# ifndef P_OS_FREEBSD
406# define P_OS_FREEBSD
407# endif
408# ifndef P_OS_DRAGONFLY
409# define P_OS_DRAGONFLY
410# endif
411# ifndef P_OS_NETBSD
412# define P_OS_NETBSD
413# endif
414# ifndef P_OS_OPENBSD
415# define P_OS_OPENBSD
416# endif
417# ifndef P_OS_AIX
418# define P_OS_AIX
419# endif
420# ifndef P_OS_HPUX
421# define P_OS_HPUX
422# endif
423# ifndef P_OS_TRU64
424# define P_OS_TRU64
425# endif
426# ifndef P_OS_SOLARIS
427# define P_OS_SOLARIS
428# endif
429# ifndef P_OS_QNX
430# define P_OS_QNX
431# endif
432# ifndef P_OS_QNX6
433# define P_OS_QNX6
434# endif
435# ifndef P_OS_BB10
436# define P_OS_BB10
437# endif
438# ifndef P_OS_SCO
439# define P_OS_SCO
440# endif
441# ifndef P_OS_UNIXWARE
442# define P_OS_UNIXWARE
443# endif
444# ifndef P_OS_IRIX
445# define P_OS_IRIX
446# endif
447# ifndef P_OS_HAIKU
448# define P_OS_HAIKU
449# endif
450# ifndef P_OS_SYLLABLE
451# define P_OS_SYLLABLE
452# endif
453# ifndef P_OS_BEOS
454# define P_OS_BEOS
455# endif
456# ifndef P_OS_OS2
457# define P_OS_OS2
458# endif
459# ifndef P_OS_VMS
460# define P_OS_VMS
461# endif
462# ifndef P_OS_AMIGA
463# define P_OS_AMIGA
464# endif
465# ifndef P_OS_UNIX
466# define P_OS_UNIX
467# endif
468# ifndef P_OS_LINUX
469# define P_OS_LINUX
470# endif
471# ifndef P_OS_MAC9
472# define P_OS_MAC9
473# endif
474# ifndef P_OS_MAC
475# define P_OS_MAC
476# endif
477# ifndef P_OS_MAC32
478# define P_OS_MAC32
479# endif
480# ifndef P_OS_MAC64
481# define P_OS_MAC64
482# endif
483# ifndef P_OS_CYGWIN
484# define P_OS_CYGWIN
485# endif
486# ifndef P_OS_MSYS
487# define P_OS_MSYS
488# endif
489# ifndef P_OS_WIN
490# define P_OS_WIN
491# endif
492# ifndef P_OS_WIN64
493# define P_OS_WIN64
494# endif
495# ifndef P_OS_ANDROID
496# define P_OS_ANDROID
497# endif
498#endif
499
500#endif /* PLIBSYS_HEADER_PMACROSOS_H */