Always include the boost-package. Otherwise it won't get searched on a second run.
[amule.git] / src / MuleVersion.h
blobe022068403fcafc010553113f194ca9ac2af15c2
1 // -*- C++ -*-
2 // This file is part of the aMule Project.
3 //
4 // Copyright (c) 2016 aMule Team ( admin@amule.org / http://www.amule.org )
5 //
6 // Any parts of this program derived from the xMule, lMule or eMule project,
7 // or contributed by third-party developers are copyrighted by their
8 // respective authors.
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 // (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., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
25 #ifndef MULEVERSION_H
26 #define MULEVERSION_H
28 #include "config.h" // Needed for VERSION and ASIO_SOCKETS
30 #ifdef ASIO_SOCKETS
31 # define MULEVERSION_RETVAL_BEGIN wxString ver(
32 # define MULEVERSION_RETVAL_END );
33 # define MULEVERSION_BOOST_VERSION ver += wxT(" and Boost ") + MuleBoostVersion;
34 # define MULEVERSION_ADD_BEGIN ver +=
35 # define MULEVERSION_ADD_END ;
36 # define MULEVERSION_RETURN_RESULT return ver;
38 /**
39 * Version of Boost aMule is compiled with.
41 * This variable exists only if aMule is compiled with Boost.Asio networking.
42 * Defined in LibSocketAsio.cpp.
44 extern wxString MuleBoostVersion;
46 #else
47 # define MULEVERSION_RETVAL_BEGIN return wxString(
48 # define MULEVERSION_RETVAL_END
49 # define MULEVERSION_BOOST_VERSION
50 # define MULEVERSION_ADD_BEGIN
51 # define MULEVERSION_ADD_END
52 # define MULEVERSION_RETURN_RESULT );
53 #endif
56 /**
57 * Returns a description of the version of aMule being used.
59 * @return A detailed description of the aMule version, including wx information.
61 * Use this rather than just using the VERSION or CURRENT_VERSION_LONG
62 * constants, when displaying information to the user. The purpose is to
63 * help with debugging.
65 inline wxString GetMuleVersion()
67 MULEVERSION_RETVAL_BEGIN
68 wxT(VERSION)
69 wxT(" compiled with ")
71 // Figure out the toolkit used by wxWidgets...
72 #if defined(__WXGTK__)
73 # if defined(__WXGTK30__)
74 # define MULEVERSION_WXTOOLKIT wxT("GTK3")
75 # elif defined(__WXGTK20__)
76 # define MULEVERSION_WXTOOLKIT wxT("GTK2")
77 # else
78 # define MULEVERSION_WXTOOLKIT wxT("GTK")
79 # endif
80 #elif defined(__WXOSX__)
81 # if defined(__WXOSX_CARBON__)
82 # define MULEVERSION_WXTOOLKIT wxT("OSX Carbon")
83 # elif defined(__WXOSX_COCOA__)
84 # define MULEVERSION_WXTOOLKIT wxT("OSX Cocoa")
85 # elif defined(__WXOSX_IPHONE__)
86 # define MULEVERSION_WXTOOLKIT wxT("OSX iPhone")
87 # else
88 # define MULEVERSION_WXTOOLKIT wxT("OSX")
89 # endif
90 #elif defined(__WXCOCOA__)
91 # define MULEVERSION_WXTOOLKIT wxT("Cocoa")
92 #elif defined(__WXMAC__)
93 # define MULEVERSION_WXTOOLKIT wxT("Mac")
94 #elif defined(__WXMSW__) || defined(__WINDOWS__)
95 # if defined(__VISUALC__)
96 # define MULEVERSION_WXTOOLKIT wxT("MSW VC")
97 # elif defined(__WXMICROWIN__)
98 # define MULEVERSION_WXTOOLKIT wxT("MicroWin")
99 # else
100 # define MULEVERSION_WXTOOLKIT wxT("MSW")
101 # endif
102 #elif defined(__NANOX__)
103 # define MULEVERSION_WXTOOLKIT wxT("NanoX")
104 #elif defined(__WXMOTIF__)
105 # define MULEVERSION_WXTOOLKIT wxT("Motif")
106 #elif defined(__WXMGL__)
107 # define MULEVERSION_WXTOOLKIT wxT("MGL")
108 #elif defined(__WXPM__)
109 # define MULEVERSION_WXTOOLKIT wxT("PM")
110 #elif defined(__WXDFB__)
111 # define MULEVERSION_WXTOOLKIT wxT("DirectFB")
112 #elif defined(__WXX11__)
113 # define MULEVERSION_WXTOOLKIT wxT("X11")
114 #endif
116 // ...and describe it.
117 #if defined(__WXBASE__)
118 wxT("wxBase")
119 # ifdef MULEVERSION_WXTOOLKIT
120 wxT("(") MULEVERSION_WXTOOLKIT wxT(")")
121 # endif
122 #elif defined(__WXUNIVERSAL__)
123 wxT("wxUniversal")
124 # ifdef MULEVERSION_WXTOOLKIT
125 wxT("(") MULEVERSION_WXTOOLKIT wxT(")")
126 # endif
127 #else
128 # ifdef MULEVERSION_WXTOOLKIT
129 wxT("wx") MULEVERSION_WXTOOLKIT
130 # else
131 wxT("wxWidgets")
132 # endif
133 #endif
135 // wxWidgets version
136 wxT(" v") wxSTRINGIZE_T(wxMAJOR_VERSION) wxT(".") wxSTRINGIZE_T(wxMINOR_VERSION) wxT(".") wxSTRINGIZE_T(wxRELEASE_NUMBER)
137 MULEVERSION_RETVAL_END
139 // Describe Boost version, if compiled with Boost.Asio
140 MULEVERSION_BOOST_VERSION
142 #if defined(__DEBUG__) || defined(SVNDATE)
143 MULEVERSION_ADD_BEGIN
144 # ifdef __DEBUG__
145 wxT(" (Debugging)")
146 # endif
147 # ifdef SVNDATE
148 wxT(" (Snapshot: ") wxT(SVNDATE) wxT(")")
149 # endif
150 MULEVERSION_ADD_END
151 #endif
153 MULEVERSION_RETURN_RESULT
156 #undef MULEVERSION_RETVAL_BEGIN
157 #undef MULEVERSION_RETVAL_END
158 #undef MULEVERSION_BOOST_VERSION
159 #undef MULEVERSION_ADD_BEGIN
160 #undef MULEVERSION_ADD_END
161 #undef MULEVERSION_RETURN_RESULT
162 #undef MULEVERSION_WXTOOLKIT
164 #endif /* MULEVERSION_H */