source: tspsg-svn/trunk/src/os.h @ 65

Last change on this file since 65 was 64, checked in by laleppa, 15 years ago

Started documenting the source code in doxygen format.

  • Property svn:keywords set to Id URL
File size: 4.1 KB
RevLine 
[31]1/*
[42]2 *  TSPSG: TSP Solver and Generator
[31]3 *  Copyright (C) 2007-2009 Lёppa <contacts[at]oleksii[dot]name>
4 *
5 *  $Id: os.h 64 2009-10-20 09:40:16Z laleppa $
6 *  $URL: https://tspsg.svn.sourceforge.net/svnroot/tspsg/trunk/src/os.h $
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
[41]27// Some target arch detection.
[64]28/*!
29 * \def ARCH
30 * \brief The target CPU architecture TSPSG was built for.
31 * \warning NOTE: Only for GNU C, Visual Studio, Intel C/C++ and MinGW32 compilers.
32 */
[41]33#if defined(__amd64__) || defined(_M_X64)
34        #define ARCH " (AMD 64-bit)"
35#elif defined(__ia64__) || defined(_M_IA64)
36        #define ARCH " (Intel 64-bit)"
[40]37#elif defined(__i386__) || defined(_M_IX86) || defined(_X86_)
[41]38        #define ARCH " (Intel x86)"
39#elif defined(__powerpc__) || defined(_M_PPC)
40        #define ARCH " (PowerPC)"
41#elif defined(__arm__) || defined(_M_ARM)
42        #define ARCH " (ARM)"
43#elif defined(__mips__) || defined(_M_MRX000)
44        #define ARCH " (MIPS)"
[37]45#else
[41]46        #define ARCH ""
47#endif // ARCH
[37]48
[56]49// Target OS detection. Done by Qt, so should work with any compiler.
[64]50/*!
51 * \def OS
52 * \brief The target operating system TSPSG was built for.
53 */
54/*!
55 * \def OSID
56 * \brief The target operating system ID.
57 *
58 * This value is used in task file metadata.
59 */
[31]60#ifdef Q_OS_AIX
[41]61        #define OS "AIX"ARCH
[31]62        #define OSID quint8(1)
63#elif defined Q_OS_BSD4
[41]64        #define OS "BSD 4.4"ARCH
[31]65        #define OSID quint8(2)
66#elif defined Q_OS_BSDI
[41]67        #define OS "BSD/OS"ARCH
[31]68        #define OSID quint8(3)
69#elif defined Q_OS_CYGWIN
[41]70        #define OS "Cygwin"ARCH
[31]71        #define OSID quint8(4)
72#elif defined Q_OS_DARWIN
[41]73        #define OS "Darwin OS"ARCH
[31]74        #define OSID quint8(5)
75#elif defined Q_OS_DGUX
[41]76        #define OS "DG/UX"ARCH
[31]77        #define OSID quint8(6)
78#elif defined Q_OS_DYNIX
[41]79        #define OS "DYNIX/ptx"ARCH
[31]80        #define OSID quint8(7)
81#elif defined Q_OS_FREEBSD
[41]82        #define OS "FreeBSD"ARCH
[31]83        #define OSID quint8(8)
84#elif defined Q_OS_HPUX
[41]85        #define OS "HP-UX"ARCH
[31]86        #define OSID quint8(9)
87#elif defined Q_OS_HURD
[41]88        #define OS "GNU Hurd"ARCH
[31]89        #define OSID quint8(10)
90#elif defined Q_OS_IRIX
[41]91        #define OS "SGI Irix"ARCH
[31]92        #define OSID quint8(11)
93#elif defined Q_OS_LINUX
[41]94        #define OS "Linux"ARCH
[31]95        #define OSID quint8(12)
96#elif defined Q_OS_LYNX
[41]97        #define OS "LynxOS"ARCH
[31]98        #define OSID quint8(13)
99#elif defined Q_OS_MSDOS
[41]100        #define OS "MS-DOS"ARCH
[31]101        #define OSID quint8(14)
102#elif defined Q_OS_NETBSD
[41]103        #define OS "NetBSD"ARCH
[31]104        #define OSID quint8(15)
105#elif defined Q_OS_OS2
[41]106        #define OS "OS/2"ARCH
[31]107        #define OSID quint8(16)
108#elif defined Q_OS_OPENBSD
[41]109        #define OS "OpenBSD"ARCH
[31]110        #define OSID quint8(17)
111#elif defined Q_OS_OS2EMX
[41]112        #define OS "OS/2"ARCH
[31]113        #define OSID quint8(18)
114#elif defined Q_OS_OSF
[41]115        #define OS "HP Tru64 UNIX"ARCH
[31]116        #define OSID quint8(19)
117#elif defined Q_OS_QNX6
[41]118        #define OS "QNX RTP 6.1"ARCH
[31]119        #define OSID quint8(20)
120#elif defined Q_OS_QNX
[41]121        #define OS "QNX"ARCH
[31]122        #define OSID quint8(21)
123#elif defined Q_OS_RELIANT
[41]124        #define OS "Reliant UNIX"ARCH
[31]125        #define OSID quint8(22)
126#elif defined Q_OS_SCO
[41]127        #define OS "SCO OpenServer 5"ARCH
[31]128        #define OSID quint8(23)
129#elif defined Q_OS_SOLARIS
[41]130        #define OS "Sun Solaris"ARCH
[31]131        #define OSID quint8(24)
132#elif defined Q_OS_ULTRIX
[41]133        #define OS "DEC Ultrix"ARCH
[31]134        #define OSID quint8(25)
135#elif defined Q_OS_UNIX
[41]136        #define OS "UNIX BSD/SYSV"ARCH
[31]137        #define OSID quint8(26)
138#elif defined Q_OS_UNIXWARE
[41]139        #define OS "UnixWare 7/Open UNIX 8"ARCH
[31]140        #define OSID quint8(27)
141#elif defined Q_OS_WIN32
[41]142        #define OS "Windows"ARCH
[31]143        #define OSID quint8(28)
144#elif defined Q_OS_WINCE
[41]145        #define OS "Windows CE"ARCH
[31]146        #define OSID quint8(29)
147#else
[41]148        #define OS "Unknown"ARCH
[31]149        #define OSID quint8(255)
[37]150#endif // OS
[31]151
152#endif // OS_H
Note: See TracBrowser for help on using the repository browser.