ManaPlus
main.h
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2004-2009 The Mana World Development Team
4  * Copyright (C) 2009-2010 The Mana Developers
5  * Copyright (C) 2011-2019 The ManaPlus Developers
6  * Copyright (C) 2019-2021 Andrei Karas
7  *
8  * This file is part of The ManaPlus Client.
9  *
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  * any later version.
14  *
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.
19  *
20  * You should have received a copy of the GNU General Public License
21  * along with this program. If not, see <http://www.gnu.org/licenses/>.
22  */
23 
24 #ifndef MAIN_H
25 #define MAIN_H
26 
44 #define SMALL_VERSION "2.1.3.17"
45 #define CHECK_VERSION "02.01.03.17"
46 
47 #ifdef HAVE_CONFIG_H
48 #include "../config.h"
49 #else // HAVE_CONFIG_H
50 #ifdef PACKAGE_VERSION
51 #undef PACKAGE_VERSION
52 #endif // PACKAGE_VERSION
53 #define PACKAGE_VERSION SMALL_VERSION;
54 #endif // HAVE_CONFIG_H
55 
56 #include "localconsts.h"
57 
58 #if defined __APPLE__
59 #define PACKAGE_OS "Mac OS X"
60 #elif defined(__ANDROID__) || defined(ANDROID)
61 #define PACKAGE_OS "Android"
62 #elif defined(__FreeBSD_kernel__) && defined(__GLIBC__)
63 #define PACKAGE_OS "kFreeBSD"
64 #elif defined __FreeBSD__ || defined __DragonFly__
65 #define PACKAGE_OS "FreeBSD"
66 #elif defined(__NetBSD__) || defined(__NetBSD)
67 #define PACKAGE_OS "NetBSD"
68 #elif defined(__OpenBSD__) || defined(__OPENBSD)
69 #define PACKAGE_OS "OpenBSD"
70 #elif defined __linux__ || defined __linux
71 #define PACKAGE_OS "Linux"
72 #elif defined __CYGWIN__
73 #define PACKAGE_OS "Cygwin"
74 #elif defined(__sun) || defined(sun)
75 #define PACKAGE_OS "SunOS"
76 #elif defined(_AIX) || defined(__AIX) || defined(__AIX__) \
77  || defined(__aix) || defined(__aix__)
78 #define PACKAGE_OS "AIX"
79 #elif defined(__sgi) || defined(__sgi__) || defined(_SGI)
80 #define PACKAGE_OS "IRIX"
81 #elif defined(__hpux) || defined(__hpux__)
82 #define PACKAGE_OS "HP-UX"
83 #elif defined(__BeOS) || defined(__BEOS__) || defined(_BEOS)
84 #define PACKAGE_OS "BeOS"
85 #elif defined(__QNX__) || defined(__QNXNTO__)
86 #define PACKAGE_OS "QNX"
87 #elif defined(__tru64) || defined(_tru64) || defined(__TRU64__)
88 #define PACKAGE_OS "Tru64"
89 #elif defined(__riscos) || defined(__riscos__)
90 #define PACKAGE_OS "RISCos"
91 #elif defined(__sinix) || defined(__sinix__) || defined(__SINIX__)
92 #define PACKAGE_OS "SINIX"
93 #elif defined(__UNIX_SV__)
94 #define PACKAGE_OS "UNIX_SV"
95 #elif defined(__bsdos__)
96 #define PACKAGE_OS "BSDOS"
97 #elif defined(_MPRAS) || defined(MPRAS)
98 #define PACKAGE_OS "MP-RAS"
99 #elif defined(__osf) || defined(__osf__)
100 #define PACKAGE_OS "OSF1"
101 #elif defined(_SCO_SV) || defined(SCO_SV) || defined(sco_sv)
102 #define PACKAGE_OS "SCO_SV"
103 #elif defined(__ultrix) || defined(__ultrix__) || defined(_ULTRIX)
104 #define PACKAGE_OS "ULTRIX"
105 #elif defined(__XENIX__) || defined(_XENIX) || defined(XENIX)
106 #define PACKAGE_OS "Xenix"
107 #elif defined(bsdi) || defined(__bsdi) || defined(__bsdi__)
108 #define PACKAGE_OS "BSDI"
109 #elif defined(_arch_dreamcast)
110 #define PACKAGE_OS "Dreamcast"
111 #elif defined(__OS2__)
112 #define PACKAGE_OS "OS/2"
113 #elif defined(osf) || defined(__osf) || defined(__osf__)
114 #define PACKAGE_OS "OSF"
115 #elif defined(riscos) || defined(__riscos) || defined(__riscos__)
116 #define PACKAGE_OS "RISC OS"
117 #elif defined(__SVR4)
118 #define PACKAGE_OS "Solaris"
119 #elif defined __GNU__
120 #define PACKAGE_OS "GNU Hurd"
121 #elif defined __HAIKU__
122 #define PACKAGE_OS "Haiku"
123 #elif defined WIN32 || defined _WIN32 || defined __WIN32__ || defined __NT__ \
124  || defined WIN64 || defined _WIN64 || defined __WIN64__ \
125  || defined __MINGW32__ || defined _MSC_VER
126 #define PACKAGE_OS "Windows"
127 #elif defined __native_client__
128 #define PACKAGE_OS "nacl"
129 #else // OTHER
130 #define PACKAGE_OS "Other"
131 #endif // defined __APPLE__
132 
133 // define DEBUG_LEAKS 1
134 // define DEBUG_CONFIG 1
135 // define DEBUG_FONT 1
136 // define DEBUG_FONT_COUNTERS 1
137 // define DEBUG_ALPHA_CACHE 1
138 // define DEBUG_OPENGL_LEAKS 1
139 
140 #define VER_INTTOSTR1(ver) #ver
141 #define VER_INTTOSTR(ver) VER_INTTOSTR1(ver)
142 #define SDL_NAME "SDL " VER_INTTOSTR(SDL_MAJOR_VERSION) "." \
143  VER_INTTOSTR(SDL_MINOR_VERSION) "." VER_INTTOSTR(SDL_PATCHLEVEL)
144 
145 #if defined(ENABLE_PUGIXML)
146 #define XML_NAME "pugixml"
147 #elif defined(ENABLE_LIBXML)
148 #define XML_NAME "libxml2"
149 #elif defined(ENABLE_TINYXML2)
150 #define XML_NAME "tinyxml2"
151 #else // defined(ENABLE_PUGIXML)
152 #define XML_NAME "unknown"
153 #endif // defined(ENABLE_PUGIXML)
154 
155 #ifdef SIMD_SUPPORTED
156 #define SIMD_NAME ", SIMD"
157 #else // SIMD_SUPPORTED
158 #define SIMD_NAME ""
159 #endif // SIMD_SUPPORTED
160 
161 #define PACKAGE_EXTENDED_VERSION "ManaPlus (" PACKAGE_OS \
162 "; %s; " SDL_NAME ", " XML_NAME SIMD_NAME ", %s; 4144 v" SMALL_VERSION ")"
163 
164 #define FULL_VERSION "ManaPlus " SMALL_VERSION " " PACKAGE_OS ", " \
165  SDL_NAME ", " XML_NAME SIMD_NAME
166 
167 #ifdef ANDROID
168 #ifdef PKG_DATADIR
169 #undef PKG_DATADIR
170 #endif // PKG_DATADIR
171 #ifdef LOCALEDIR
172 #undef LOCALEDIR
173 #endif // LOCALEDIR
174 #define LOCALEDIR "locale"
175 #endif // ANDROID
176 
177 #ifndef PKG_DATADIR
178 #define PKG_DATADIR ""
179 #endif // PKG_DATADIR
180 
181 #endif // MAIN_H