File: compiler.cpp

package info (click to toggle)
inspircd 4.7.0%2Bds1-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 7,776 kB
  • sloc: cpp: 110,200; ansic: 4,576; perl: 2,286; python: 169; sh: 132; sql: 99; makefile: 58
file content (53 lines) | stat: -rw-r--r-- 1,813 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
/*
 * InspIRCd -- Internet Relay Chat Daemon
 *
 *   Copyright (C) 2014, 2024 Sadie Powell <sadie@witchery.services>
 *
 * This file is part of InspIRCd.  InspIRCd is free software: you can
 * redistribute it and/or modify it under the terms of the GNU General Public
 * License as published by the Free Software Foundation, version 2.
 *
 * This program is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 * details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */


#include <iostream>

#if defined __INTEL_CLANG_COMPILER // Also defines __clang__
# define INSPIRCD_COMPILER_NAME "IntelClang"
# define INSPIRCD_COMPILER_VERSION (__INTEL_CLANG_COMPILER / 10000) << '.' << ((__INTEL_CLANG_COMPILER % 10000) / 100)
#elif defined __clang__ // Also defines __GNUC__
# if defined __apple_build_version__
#  define INSPIRCD_COMPILER_NAME "AppleClang"
# else
#  define INSPIRCD_COMPILER_NAME "Clang"
#  if __clang_major__ < 9
#   define INSPIRCD_EXTRA_LDLIBS "-lc++fs"
#  endif
# endif
# define INSPIRCD_COMPILER_VERSION __clang_major__ << '.' << __clang_minor__
#elif defined __GNUC__
# define INSPIRCD_COMPILER_NAME "GCC"
# define INSPIRCD_COMPILER_VERSION __GNUC__ << '.' << __GNUC_MINOR__
# if __GNUC__ < 9
#  define INSPIRCD_EXTRA_LDLIBS "-lstdc++fs"
# endif
#endif

#ifndef INSPIRCD_EXTRA_LDLIBS
# define INSPIRCD_EXTRA_LDLIBS ""
#endif

int main() {
	std::cout
		<< "NAME " << INSPIRCD_COMPILER_NAME << std::endl
		<< "VERSION " << INSPIRCD_COMPILER_VERSION << std::endl
		<< "EXTRA_LDLIBS " << INSPIRCD_EXTRA_LDLIBS << std::endl;
	return 0;
}