Remove do-nothing command and add warning about it
[amule.git] / src / Types.h
blob098e02672ff188f7e1e03569b877653e4553ecc5
1 //
2 // This file is part of the aMule Project.
3 //
4 // Copyright (c) 2003-2011 aMule Team ( admin@amule.org / http://www.amule.org )
5 // Copyright (c) 2002-2011 Merkur ( devs@emule-project.net / http://www.emule-project.net )
6 //
7 // Any parts of this program derived from the xMule, lMule or eMule project,
8 // or contributed by third-party developers are copyrighted by their
9 // respective authors.
11 // This program is free software; you can redistribute it and/or modify
12 // it under the terms of the GNU General Public License as published by
13 // the Free Software Foundation; either version 2 of the License, or
14 // (at your option) any later version.
16 // This program is distributed in the hope that it will be useful,
17 // but WITHOUT ANY WARRANTY; without even the implied warranty of
18 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 // GNU General Public License for more details.
21 // You should have received a copy of the GNU General Public License
22 // along with this program; if not, write to the Free Software
23 // Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
26 #ifndef TYPES_H
27 #define TYPES_H
29 #ifndef USE_STD_STRING
30 #include <wx/string.h> // Needed for wxString and wxEmptyString
31 #endif
33 #include <list> // Needed for std::list
34 #include <vector> // Needed for std::vector
36 #ifndef _MSC_VER
37 #ifndef __STDC_FORMAT_MACROS
38 #define __STDC_FORMAT_MACROS
39 #endif
40 #include <inttypes.h>
41 #define LONGLONG(x) x##ll
42 #define ULONGLONG(x) x##llu
43 #else
44 typedef unsigned __int8 uint8_t;
45 typedef unsigned __int16 uint16_t;
46 typedef unsigned __int32 uint32_t;
47 typedef unsigned __int64 uint64_t;
48 typedef signed __int8 int8_t;
49 typedef signed __int16 int16_t;
50 typedef signed __int32 int32_t;
51 typedef signed __int64 int64_t;
52 #define LONGLONG(x) x##i64
53 #define ULONGLONG(x) x##ui64
54 #endif
56 // These are _MSC_VER defines used in eMule. They should
57 // not be used in aMule, instead, use this table to
58 // find the type to use in order to get the desired
59 // effect.
60 //////////////////////////////////////////////////
61 // Name // Type To Use In Amule //
62 //////////////////////////////////////////////////
63 // BOOL // bool //
64 // WORD // uint16 //
65 // INT // int32 //
66 // UINT // uint32 //
67 // UINT_PTR // uint32* //
68 // PUINT // uint32* //
69 // DWORD // uint32 //
70 // LONG // long //
71 // ULONG // unsigned long //
72 // LONGLONG // long long //
73 // ULONGLONG // unsigned long long //
74 // LPBYTE // char* //
75 // VOID // void //
76 // PVOID // void* //
77 // LPVOID // void* //
78 // LPCVOID // const void* //
79 // CHAR // char //
80 // LPSTR // char* //
81 // LPCSTR // const char* //
82 // TCHAR // char //
83 // LPTSTR // char* //
84 // LPCTSTR // const char* //
85 // WCHAR // wchar_t //
86 // LPWSTR // wchar_t* //
87 // LPCWSTR // const wchar_t* //
88 // WPARAM // uint16 //
89 // LPARAM // uint32 //
90 // POINT // wxPoint //
91 //////////////////////////////////////////////////
94 * Backwards compatibility with emule.
95 * Note that the int* types are indeed unsigned.
97 typedef uint8_t int8;
98 typedef uint8_t uint8;
99 typedef uint16_t int16;
100 typedef uint16_t uint16;
101 typedef uint32_t int32;
102 typedef uint32_t uint32;
103 typedef uint64_t int64;
104 typedef uint64_t uint64;
105 typedef int8_t sint8;
106 typedef int16_t sint16;
107 typedef int32_t sint32;
108 typedef int64_t sint64;
111 class CKnownFile;
113 //! Various common list-types.
114 //@{
115 #ifndef USE_STD_STRING
116 typedef std::list<wxString> CStringList;
117 #endif
118 typedef std::list<CKnownFile*> CKnownFilePtrList;
119 //@}
121 typedef std::vector<uint8> ArrayOfUInts8;
122 typedef std::vector<uint16> ArrayOfUInts16;
123 typedef std::vector<uint32> ArrayOfUInts32;
124 typedef std::vector<uint64> ArrayOfUInts64;
126 typedef std::list<uint32> ListOfUInts32;
128 /* This is the Evil Void String For Returning On Const References From Hell */
129 // IT MEANS I WANT TO USE IT EVERYWHERE. DO NOT MOVE IT.
130 // THE FACT SOMETHING IS USED IN JUST ONE PLACE DOESN'T MEAN IT HAS
131 // TO BE MOVED TO THAT PLACE. I MIGHT NEED IT ELSEWHERE LATER.
134 #ifndef USE_STD_STRING
135 static const wxString EmptyString = wxEmptyString;
136 #endif
138 #ifndef __cplusplus
139 typedef int bool;
140 #endif
143 #ifdef _WIN32 // Used in non-wx-apps too (ed2k), so don't use __WINDOWS__ here !
144 #ifndef NOMINMAX
145 #define NOMINMAX
146 #endif
147 #include <windows.h> // Needed for RECT // Do_not_auto_remove
148 // Windows compilers don't have these constants
149 #ifndef W_OK
150 enum
152 F_OK = 0, // test for existence
153 X_OK = 1, // execute permission
154 W_OK = 2, // write
155 R_OK = 4 // read
157 #endif // W_OK
158 #ifdef __WINDOWS__
159 #include <wx/msw/winundef.h> // Do_not_auto_remove
160 #endif
161 #undef GetUserName
162 #else // _WIN32
163 typedef struct sRECT {
164 uint32 left;
165 uint32 top;
166 uint32 right;
167 uint32 bottom;
168 } RECT;
169 #endif /* _WIN32 */
172 #endif /* TYPES_H */
173 // File_checked_for_headers