]> git.netwichtig.de Git - user/henk/code/inspircd.git/blob - make/test/compiler_info.cpp
Update copyright headers.
[user/henk/code/inspircd.git] / make / test / compiler_info.cpp
1 /*
2  * InspIRCd -- Internet Relay Chat Daemon
3  *
4  *   Copyright (C) 2017 Sadie Powell <sadie@witchery.services>
5  *
6  * This file is part of InspIRCd.  InspIRCd is free software: you can
7  * redistribute it and/or modify it under the terms of the GNU General Public
8  * License as published by the Free Software Foundation, version 2.
9  *
10  * This program is distributed in the hope that it will be useful, but WITHOUT
11  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
12  * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
13  * details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
17  */
18
19
20 #include <iostream>
21
22 #if defined __INTEL_COMPILER // Also defines __clang__ and __GNUC__
23 # define INSPIRCD_COMPILER_NAME "Intel"
24 # define INSPIRCD_COMPILER_VERSION (__INTEL_COMPILER / 100) << '.' << (__INTEL_COMPILER % 100)
25 #elif defined __clang__ // Also defines __GNUC__
26 # if defined __apple_build_version__
27 #  define INSPIRCD_COMPILER_NAME "AppleClang"
28 # else
29 #  define INSPIRCD_COMPILER_NAME "Clang"
30 # endif
31 # define INSPIRCD_COMPILER_VERSION __clang_major__ << '.' << __clang_minor__
32 #elif defined __GNUC__
33 # define INSPIRCD_COMPILER_NAME "GCC"
34 # define INSPIRCD_COMPILER_VERSION __GNUC__ << '.' << __GNUC_MINOR__
35 #endif
36
37 int main() {
38         std::cout << "NAME " << INSPIRCD_COMPILER_NAME << std::endl
39                 << "VERSION " << INSPIRCD_COMPILER_VERSION << std::endl;
40         return 0;
41 }