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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164 | // -*- C++ -*-
// This file is part of the aMule Project.
//
// Copyright (c) 2016 aMule Team ( admin@amule.org / http://www.amule.org )
//
// Any parts of this program derived from the xMule, lMule or eMule project,
// or contributed by third-party developers are copyrighted by their
// respective authors.
//
// This program 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; either version 2 of the License, or
// (at your option) any later version.
//
// 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, write to the Free Software
// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
//
#ifndef MULEVERSION_H
#define MULEVERSION_H
#include "config.h" // Needed for VERSION and ASIO_SOCKETS
#ifdef ASIO_SOCKETS
# define MULEVERSION_RETVAL_BEGIN wxString ver(
# define MULEVERSION_RETVAL_END );
# define MULEVERSION_BOOST_VERSION ver += wxT(" and Boost ") + MuleBoostVersion;
# define MULEVERSION_ADD_BEGIN ver +=
# define MULEVERSION_ADD_END ;
# define MULEVERSION_RETURN_RESULT return ver;
/**
* Version of Boost aMule is compiled with.
*
* This variable exists only if aMule is compiled with Boost.Asio networking.
* Defined in LibSocketAsio.cpp.
*/
extern wxString MuleBoostVersion;
#else
# define MULEVERSION_RETVAL_BEGIN return wxString(
# define MULEVERSION_RETVAL_END
# define MULEVERSION_BOOST_VERSION
# define MULEVERSION_ADD_BEGIN
# define MULEVERSION_ADD_END
# define MULEVERSION_RETURN_RESULT );
#endif
/**
* Returns a description of the version of aMule being used.
*
* @return A detailed description of the aMule version, including wx information.
*
* Use this rather than just using the VERSION or CURRENT_VERSION_LONG
* constants, when displaying information to the user. The purpose is to
* help with debugging.
*/
inline wxString GetMuleVersion()
{
MULEVERSION_RETVAL_BEGIN
wxT(VERSION)<--- There is an unknown macro here somewhere. Configuration is required. If wxT is a macro then please configure it.
wxT(" compiled with ")
// Figure out the toolkit used by wxWidgets...
#if defined(__WXGTK__)
# if defined(__WXGTK30__)
# define MULEVERSION_WXTOOLKIT wxT("GTK3")
# elif defined(__WXGTK20__)
# define MULEVERSION_WXTOOLKIT wxT("GTK2")
# else
# define MULEVERSION_WXTOOLKIT wxT("GTK")
# endif
#elif defined(__WXOSX__)
# if defined(__WXOSX_CARBON__)
# define MULEVERSION_WXTOOLKIT wxT("OSX Carbon")
# elif defined(__WXOSX_COCOA__)
# define MULEVERSION_WXTOOLKIT wxT("OSX Cocoa")
# elif defined(__WXOSX_IPHONE__)
# define MULEVERSION_WXTOOLKIT wxT("OSX iPhone")
# else
# define MULEVERSION_WXTOOLKIT wxT("OSX")
# endif
#elif defined(__WXCOCOA__)
# define MULEVERSION_WXTOOLKIT wxT("Cocoa")
#elif defined(__WXMAC__)
# define MULEVERSION_WXTOOLKIT wxT("Mac")
#elif defined(__WXMSW__) || defined(__WINDOWS__)
# if defined(__VISUALC__)
# define MULEVERSION_WXTOOLKIT wxT("MSW VC")
# elif defined(__WXMICROWIN__)
# define MULEVERSION_WXTOOLKIT wxT("MicroWin")
# else
# define MULEVERSION_WXTOOLKIT wxT("MSW")
# endif
#elif defined(__NANOX__)
# define MULEVERSION_WXTOOLKIT wxT("NanoX")
#elif defined(__WXMOTIF__)
# define MULEVERSION_WXTOOLKIT wxT("Motif")
#elif defined(__WXMGL__)
# define MULEVERSION_WXTOOLKIT wxT("MGL")
#elif defined(__WXPM__)
# define MULEVERSION_WXTOOLKIT wxT("PM")
#elif defined(__WXDFB__)
# define MULEVERSION_WXTOOLKIT wxT("DirectFB")
#elif defined(__WXX11__)
# define MULEVERSION_WXTOOLKIT wxT("X11")
#endif
// ...and describe it.
#if defined(__WXBASE__)
wxT("wxBase")
# ifdef MULEVERSION_WXTOOLKIT
wxT("(") MULEVERSION_WXTOOLKIT wxT(")")
# endif
#elif defined(__WXUNIVERSAL__)
wxT("wxUniversal")
# ifdef MULEVERSION_WXTOOLKIT
wxT("(") MULEVERSION_WXTOOLKIT wxT(")")
# endif
#else
# ifdef MULEVERSION_WXTOOLKIT
wxT("wx") MULEVERSION_WXTOOLKIT
# else
wxT("wxWidgets")
# endif
#endif
// wxWidgets version
wxT(" v") wxSTRINGIZE_T(wxMAJOR_VERSION) wxT(".") wxSTRINGIZE_T(wxMINOR_VERSION) wxT(".") wxSTRINGIZE_T(wxRELEASE_NUMBER)
MULEVERSION_RETVAL_END
// Describe Boost version, if compiled with Boost.Asio
MULEVERSION_BOOST_VERSION
#if defined(__DEBUG__) || defined(SVNDATE)
MULEVERSION_ADD_BEGIN
# ifdef __DEBUG__
wxT(" (Debugging)")
# endif
# ifdef SVNDATE
wxT(" (Snapshot: ") wxT(SVNDATE) wxT(")")
# endif
MULEVERSION_ADD_END
#endif
MULEVERSION_RETURN_RESULT
}
#undef MULEVERSION_RETVAL_BEGIN
#undef MULEVERSION_RETVAL_END
#undef MULEVERSION_BOOST_VERSION
#undef MULEVERSION_ADD_BEGIN
#undef MULEVERSION_ADD_END
#undef MULEVERSION_RETURN_RESULT
#undef MULEVERSION_WXTOOLKIT
#endif /* MULEVERSION_H */
|