source: tspsg/src/os.h @ 85ad815b0b

0.1.3.145-beta1-symbian0.1.4.170-beta2-bb10appveyorimgbotreadme
Last change on this file since 85ad815b0b was 85ad815b0b, checked in by Oleksii Serdiuk, 15 years ago

Some documentation updates.

  • Property mode set to 100644
File size: 4.4 KB
Line 
1/*
2 *  TSPSG: TSP Solver and Generator
3 *  Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
4 *
5 *  $Id$
6 *  $URL$
7 *
8 *  This file is part of TSPSG.
9 *
10 *  TSPSG is free software: you can redistribute it and/or modify
11 *  it under the terms of the GNU General Public License as published by
12 *  the Free Software Foundation, either version 3 of the License, or
13 *  (at your option) any later version.
14 *
15 *  TSPSG is distributed in the hope that it will be useful,
16 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
17 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 *  GNU General Public License for more details.
19 *
20 *  You should have received a copy of the GNU General Public License
21 *  along with TSPSG.  If not, see <http://www.gnu.org/licenses/>.
22 */
23
24#ifndef OS_H
25#define OS_H
26
27/*!
28 * \file os.h
29 * \brief This file contains TSPSG target CPU architecture and OS detection.
30 *
31 *  Arch detection works only for <b>GNU C</b>, <b>Visual Studio</b>, <b>Intel C/C++</b> and <b>MinGW32</b> compilers.
32 *
33 *  OS detection should work for any compiler.
34 */
35
36// Some target arch detection.
37/*!
38 * \def ARCH
39 * \brief The target CPU architecture TSPSG was built for.
40 * \warning NOTE: Only for <b>GNU C</b>, <b>Visual Studio</b>, <b>Intel C/C++</b> and <b>MinGW32</b> compilers.
41 */
42#if defined(__amd64__) || defined(_M_X64)
43        #define ARCH " (AMD 64-bit)"
44#elif defined(__ia64__) || defined(_M_IA64)
45        #define ARCH " (Intel 64-bit)"
46#elif defined(__i386__) || defined(_M_IX86) || defined(_X86_)
47        #define ARCH " (Intel x86)"
48#elif defined(__powerpc__) || defined(_M_PPC)
49        #define ARCH " (PowerPC)"
50#elif defined(__arm__) || defined(_M_ARM)
51        #define ARCH " (ARM)"
52#elif defined(__mips__) || defined(_M_MRX000)
53        #define ARCH " (MIPS)"
54#else
55        #define ARCH ""
56#endif // ARCH
57
58// Target OS detection. Done by Qt, so should work for any compiler.
59/*!
60 * \def OS
61 * \brief The target operating system TSPSG was built for.
62 */
63/*!
64 * \def OSID
65 * \brief The target operating system ID.
66 *
67 * This value is used in task file metadata.
68 */
69#ifdef Q_OS_AIX
70        #define OS "AIX"ARCH
71        #define OSID quint8(1)
72#elif defined Q_OS_BSD4
73        #define OS "BSD 4.4"ARCH
74        #define OSID quint8(2)
75#elif defined Q_OS_BSDI
76        #define OS "BSD/OS"ARCH
77        #define OSID quint8(3)
78#elif defined Q_OS_CYGWIN
79        #define OS "Cygwin"ARCH
80        #define OSID quint8(4)
81#elif defined Q_OS_DARWIN
82        #define OS "Darwin OS"ARCH
83        #define OSID quint8(5)
84#elif defined Q_OS_DGUX
85        #define OS "DG/UX"ARCH
86        #define OSID quint8(6)
87#elif defined Q_OS_DYNIX
88        #define OS "DYNIX/ptx"ARCH
89        #define OSID quint8(7)
90#elif defined Q_OS_FREEBSD
91        #define OS "FreeBSD"ARCH
92        #define OSID quint8(8)
93#elif defined Q_OS_HPUX
94        #define OS "HP-UX"ARCH
95        #define OSID quint8(9)
96#elif defined Q_OS_HURD
97        #define OS "GNU Hurd"ARCH
98        #define OSID quint8(10)
99#elif defined Q_OS_IRIX
100        #define OS "SGI Irix"ARCH
101        #define OSID quint8(11)
102#elif defined Q_OS_LINUX
103        #define OS "Linux"ARCH
104        #define OSID quint8(12)
105#elif defined Q_OS_LYNX
106        #define OS "LynxOS"ARCH
107        #define OSID quint8(13)
108#elif defined Q_OS_MSDOS
109        #define OS "MS-DOS"ARCH
110        #define OSID quint8(14)
111#elif defined Q_OS_NETBSD
112        #define OS "NetBSD"ARCH
113        #define OSID quint8(15)
114#elif defined Q_OS_OS2
115        #define OS "OS/2"ARCH
116        #define OSID quint8(16)
117#elif defined Q_OS_OPENBSD
118        #define OS "OpenBSD"ARCH
119        #define OSID quint8(17)
120#elif defined Q_OS_OS2EMX
121        #define OS "OS/2"ARCH
122        #define OSID quint8(18)
123#elif defined Q_OS_OSF
124        #define OS "HP Tru64 UNIX"ARCH
125        #define OSID quint8(19)
126#elif defined Q_OS_QNX6
127        #define OS "QNX RTP 6.1"ARCH
128        #define OSID quint8(20)
129#elif defined Q_OS_QNX
130        #define OS "QNX"ARCH
131        #define OSID quint8(21)
132#elif defined Q_OS_RELIANT
133        #define OS "Reliant UNIX"ARCH
134        #define OSID quint8(22)
135#elif defined Q_OS_SCO
136        #define OS "SCO OpenServer 5"ARCH
137        #define OSID quint8(23)
138#elif defined Q_OS_SOLARIS
139        #define OS "Sun Solaris"ARCH
140        #define OSID quint8(24)
141#elif defined Q_OS_ULTRIX
142        #define OS "DEC Ultrix"ARCH
143        #define OSID quint8(25)
144#elif defined Q_OS_UNIX
145        #define OS "UNIX BSD/SYSV"ARCH
146        #define OSID quint8(26)
147#elif defined Q_OS_UNIXWARE
148        #define OS "UnixWare 7/Open UNIX 8"ARCH
149        #define OSID quint8(27)
150#elif defined Q_OS_WIN32
151        #define OS "Windows"ARCH
152        #define OSID quint8(28)
153#elif defined Q_OS_WINCE
154        #define OS "Windows CE"ARCH
155        #define OSID quint8(29)
156#else
157        #define OS "Unknown"ARCH
158        #define OSID quint8(255)
159#endif // OS
160
161#endif // OS_H
Note: See TracBrowser for help on using the repository browser.