2
* platform_compiler.h - compiler discovery macros.
5
* Marco van den Heuvel <blackystardust68@yahoo.com>
7
* This file is part of VICE, the Versatile Commodore Emulator.
8
* See README for copyright notice.
10
* This program 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 2 of the License, or
13
* (at your option) any later version.
15
* This program 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.
20
* You should have received a copy of the GNU General Public License
21
* along with this program; if not, write to the Free Software
22
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
27
/* Compilers supported:
30
* ------------------------------------------------------
33
* compaq/dec | yes, but wrong version format for now
34
* dignus systems | yes
50
#ifndef VICE_PLATFORM_COMPILER_H
51
#define VICE_PLATFORM_COMPILER_H
55
#define QUOTE(x) XQUOTE(x)
59
#if !defined(PLATFORM_COMPILER) && defined(__clang__)
60
#define PLATFORM_COMPILER "clang " QUOTE(__clang_major__) "." QUOTE(__clang_minor__) "." QUOTE(__clang_patchlevel__)
64
#if !defined(PLATFORM_COMPILER) && defined(__GNUC__)
66
# define PLATFORM_COMPILER "GCC-" QUOTE(__GNUC__) "." QUOTE(__GNUC_MINOR__) "." QUOTE(__GNUC_PATCHLEVEL__)
68
# define PLATFORM_COMPILER "GCC-" QUOTE(__GNUC__) "." QUOTE(__GNUC_MINOR__)
73
#if !defined(PLATFORM_COMPILER) && defined(__APPLE__) && defined(llvm)
74
#define PLATFORM_COMPILER "llvm"
78
#if !defined(PLATFORM_COMPILER) && defined( _AIX) && defined(__TOS_AIX__)
79
#define PLATFORM_COMPILER "xLC"
82
/* HP UPC discovery */
83
#if !defined(PLATFORM_COMPILER) && defined(_hpux)
84
#define PLATFORM_COMPILER "HP UPC"
87
/* Comeau compiler discovery */
88
#if !defined(PLATFORM_COMPILER) && defined(__COMO__)
89
#define PLATFORM_COMPILER "Comeau c++ " QUOTE(__COMO_VERSION__)
90
#define PLATFORM_COMPILER_NAME "Comeau c++"
91
#define PLATFORM_COMPILER_VERSION __COMO_VERSION__
92
#define PLATFORM_COMPILER_MAJOR_MASK 100
93
#define PLATFORM_COMPILER_MINOR_MASK 1
96
/* Intel compiler discovery */
97
#if !defined(PLATFORM_COMPILER) && defined(__INTEL_COMPILER)
98
#define PLATFORM_COMPILER "Intel Compiler " QUOTE(__INTEL_COMPILER)
99
#define PLATFORM_COMPILER_NAME "Intel Compiler"
100
#define PLATFORM_COMPILER_VERSION __INTEL_COMPILER
101
#define PLATFORM_COMPILER_MAJOR_MASK 100
102
#define PLATFORM_COMPILER_MINOR_MASK 10
103
#define PLATFORM_COMPILER_PATCHLEVEL_MASK 1
106
/* compaq/dec compiler discovery */
107
#if !defined(PLATFORM_COMPILER) && defined(__DECC)
108
#define PLATFORM_COMPILER "Compaq/DEC compiler " QUOTE(__DECC_VER)
111
/* Dignus Systems compiler discovery */
112
#if !defined(PLATFORM_COMPILER) && defined(__SYSC__)
113
#define PLATFORM_COMPILER "Dignus Systems compiler " QUOTE(__SYSC_VER__)
114
#define PLATFORM_COMPILER_NAME "Dignus Systems compiler"
115
#define PLATFORM_COMPILER_VERSION __SYSC_VER__
116
#define PLATFORM_COMPILER_MAJOR_MASK 10000
117
#define PLATFORM_COMPILER_MINOR_MASK 100
118
#define PLATFORM_COMPILER_PATCHLEVEL_MASK 1
121
/* EKOPath compiler discovery */
122
#if !defined(PLATFORM_COMPILER) && defined(__PATHCC__)
123
#define PLATFORM_COMPILER "EKOPath compiler " QUOTE(__PATHCC__) "." QUOTE(__PATHCC_MINOR__) "." QUOTE(__PATHCC_PATCHLEVEL__)
126
/* Green Hill C/C++ compiler discovery */
127
#if !defined(PLATFORM_COMPILER) && defined(__ghs__)
128
#define PLATFORM_COMPILER "Green Hill C/C++ " QUOTE(__GHS_VERSION_NUMBER__)
129
#define PLATFORM_COMPILER_NAME "Green Hill C/C++"
130
#define PLATFORM_COMPILER_VERSION __GHS_VERSION_NUMBER__
131
#define PLATFORM_COMPILER_MAJOR_MASK 100
132
#define PLATFORM_COMPILER_MINOR_MASK 10
133
#define PLATFORM_COMPILER_PATCHLEVEL_MASK 1
136
/* MetroWerks compiler discovery */
137
#if !defined(PLATFORM_COMPILER) && defined(__MWERKS__)
139
#define PLATFORM_COMPILER "MetroWerks " QUOTE(__MWERKS__)
140
#define PLATFORM_COMPILER_NAME "MetroWerks"
141
#define PLATFORM_COMPILER_VERSION __MWERKS__
142
#define PLATFORM_COMPILER_MAJOR_MASK 0x1000
143
#define PLATFORM_COMPILER_MINOR_MASK 0x100
145
#define PLATFORM_COMPILER "MetroWerks"
149
/* MIPSpro compiler discovery */
150
#if !defined(PLATFORM_COMPILER) && (defined(__sgi) || defined(sgi))
151
#if defined(_COMPILER_VERSION) || defined(_SGI_COMPILER_VERSION)
152
#ifdef _COMPILER_VERSION
153
#define PLATFORM_COMPILER "MIPSpro " QUOTE(_COMPILER_VERSION)
154
#define PLATFORM_COMPILER_VERSION _COMPILER_VERSION
156
#define PLATFORM_COMPILER "MIPSpro" QUOTE(_SGI_COMPILER_VERSION)
157
#define PLATFORM_COMPILER_VERSION _SGI_COMPILER_VERSION
159
#define PLATFORM_COMPILER_NAME "MIPSpro"
160
#define PLATFORM_COMPILER_MAJOR_MASK 100
161
#define PLATFORM_COMPILER_MINOR_MASK 10
162
#define PLATFORM_COMPILER_PATCHLEVEL_MASK 1
164
#define PLATFORM_COMPILER "MIPSpro"
168
/* RealView C compiler discovery */
169
#if !defined(PLATFORM_COMPILER) && defined(__CC_ARM)
170
#define PLATFORM_COMPILER "RealView C " QUOTE(__ARMCC_VERSION)
171
#define PLATFORM_COMPILER_NAME "RealView C"
172
#define PLATFORM_COMPILER_VERSION __ARMCC_VERSION
173
#define PLATFORM_COMPILER_MAJOR_MASK 100000
174
#define PLATFORM_COMPILER_MINOR_MASK 10000
175
#define PLATFORM_COMPILER_PATCHLEVEL_MASK 1000
178
/* SAS/C compiler discovery */
179
#if !defined(PLATFORM_COMPILER) && defined(__SASC)
181
#define PLATFORM_COMPILER "SAS/C " QUOTE(__VERSION__) "." QUOTE(__REVISION__)
183
#define PLATFORM_COMPILER "SASC " QUOTE(__SASC__)
184
#define PLATFORM_COMPILER_NAME "SAS/C"
185
#define PLATFORM_COMPILER_VERSION ___SASC__
186
#define PLATFORM_COMPILER_MAJOR_MASK 100
187
#define PLATFORM_COMPILER_MINOR_MASK 1
191
/* Sun Studio compiler discovery */
192
#if !defined(PLATFORM_COMPILER) && defined(__SUNPRO_C)
193
#define PLATFORM_COMPILER "Sun Studio Compiler " QUOTE(__SUNPRO_C)
194
#define PLATFORM_COMPILER_NAME "Sun Studio Compiler"
195
#define PLATFORM_COMPILER_VERSION __SUNPRO_C
196
#define PLATFORM_COMPILER_MAJOR_MASK 0x100
197
#define PLATFORM_COMPILER_MINOR_MASK 0x10
198
#define PLATFORM_COMPILER_PATCHLEVEL_MASK 1
201
/* Tiny C compiler discovery */
202
#if !defined(PLATFORM_COMPILER) && defined(__TINYC__)
203
#define PLATFORM_COMPILER "Tiny C"