2 // This file is part of the aMule Project.
4 // Copyright (c) 2016 aMule Team ( admin@amule.org / http://www.amule.org )
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
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
29 # include "config.h" // Needed for VERSION and ASIO_SOCKETS
31 # include "common/ClientVersion.h" // Needed for VERSION otherwise
35 # define MULEVERSION_RETVAL_BEGIN wxString ver(
36 # define MULEVERSION_RETVAL_END );
37 # define MULEVERSION_BOOST_VERSION ver += wxT(" and Boost ") + MuleBoostVersion;
38 # define MULEVERSION_ADD_BEGIN ver +=
39 # define MULEVERSION_ADD_END ;
40 # define MULEVERSION_RETURN_RESULT return ver;
43 * Version of Boost aMule is compiled with.
45 * This variable exists only if aMule is compiled with Boost.Asio networking.
46 * Defined in LibSocketAsio.cpp.
48 extern wxString MuleBoostVersion
;
51 # define MULEVERSION_RETVAL_BEGIN return wxString(
52 # define MULEVERSION_RETVAL_END
53 # define MULEVERSION_BOOST_VERSION
54 # define MULEVERSION_ADD_BEGIN
55 # define MULEVERSION_ADD_END
56 # define MULEVERSION_RETURN_RESULT );
61 * Returns a description of the version of aMule being used.
63 * @return A detailed description of the aMule version, including wx information.
65 * Use this rather than just using the VERSION or CURRENT_VERSION_LONG
66 * constants, when displaying information to the user. The purpose is to
67 * help with debugging.
69 inline wxString
GetMuleVersion()
71 MULEVERSION_RETVAL_BEGIN
73 wxT(" compiled with ")
75 // Figure out the toolkit used by wxWidgets...
76 #if defined(__WXGTK__)
77 # if defined(__WXGTK30__)
78 # define MULEVERSION_WXTOOLKIT wxT("GTK3")
79 # elif defined(__WXGTK20__)
80 # define MULEVERSION_WXTOOLKIT wxT("GTK2")
82 # define MULEVERSION_WXTOOLKIT wxT("GTK")
84 #elif defined(__WXOSX__)
85 # if defined(__WXOSX_CARBON__)
86 # define MULEVERSION_WXTOOLKIT wxT("OSX Carbon")
87 # elif defined(__WXOSX_COCOA__)
88 # define MULEVERSION_WXTOOLKIT wxT("OSX Cocoa")
89 # elif defined(__WXOSX_IPHONE__)
90 # define MULEVERSION_WXTOOLKIT wxT("OSX iPhone")
92 # define MULEVERSION_WXTOOLKIT wxT("OSX")
94 #elif defined(__WXCOCOA__)
95 # define MULEVERSION_WXTOOLKIT wxT("Cocoa")
96 #elif defined(__WXMAC__)
97 # define MULEVERSION_WXTOOLKIT wxT("Mac")
98 #elif defined(__WXMSW__) || defined(__WINDOWS__)
99 # if defined(__VISUALC__)
100 # define MULEVERSION_WXTOOLKIT wxT("MSW VC")
101 # elif defined(__WXMICROWIN__)
102 # define MULEVERSION_WXTOOLKIT wxT("MicroWin")
104 # define MULEVERSION_WXTOOLKIT wxT("MSW")
106 #elif defined(__NANOX__)
107 # define MULEVERSION_WXTOOLKIT wxT("NanoX")
108 #elif defined(__WXMOTIF__)
109 # define MULEVERSION_WXTOOLKIT wxT("Motif")
110 #elif defined(__WXMGL__)
111 # define MULEVERSION_WXTOOLKIT wxT("MGL")
112 #elif defined(__WXPM__)
113 # define MULEVERSION_WXTOOLKIT wxT("PM")
114 #elif defined(__WXDFB__)
115 # define MULEVERSION_WXTOOLKIT wxT("DirectFB")
116 #elif defined(__WXX11__)
117 # define MULEVERSION_WXTOOLKIT wxT("X11")
120 // ...and describe it.
121 #if defined(__WXBASE__)
123 # ifdef MULEVERSION_WXTOOLKIT
124 wxT("(") MULEVERSION_WXTOOLKIT
wxT(")")
126 #elif defined(__WXUNIVERSAL__)
128 # ifdef MULEVERSION_WXTOOLKIT
129 wxT("(") MULEVERSION_WXTOOLKIT
wxT(")")
132 # ifdef MULEVERSION_WXTOOLKIT
133 wxT("wx") MULEVERSION_WXTOOLKIT
140 wxT(" v") wxSTRINGIZE_T(wxMAJOR_VERSION
) wxT(".") wxSTRINGIZE_T(wxMINOR_VERSION
) wxT(".") wxSTRINGIZE_T(wxRELEASE_NUMBER
)
141 MULEVERSION_RETVAL_END
143 // Describe Boost version, if compiled with Boost.Asio
144 MULEVERSION_BOOST_VERSION
146 #if defined(__DEBUG__) || defined(SVNDATE)
147 MULEVERSION_ADD_BEGIN
152 wxT(" (Snapshot: ") wxT(SVNDATE
) wxT(")")
157 MULEVERSION_RETURN_RESULT
160 #undef MULEVERSION_RETVAL_BEGIN
161 #undef MULEVERSION_RETVAL_END
162 #undef MULEVERSION_BOOST_VERSION
163 #undef MULEVERSION_ADD_BEGIN
164 #undef MULEVERSION_ADD_END
165 #undef MULEVERSION_RETURN_RESULT
166 #undef MULEVERSION_WXTOOLKIT
168 #endif /* MULEVERSION_H */