6 #if ( !defined(PREP_H) && defined(__cplusplus) ) 12 #ifndef wxMAJOR_VERSION 31 template <
int major,
int minor = 0,
int revision = 0>
struct Version {
enum { eval = (major<<25) + (minor<<15) + revision }; };
32 inline void Version2MMR(
int v,
int& major,
int& minor,
int& revision) { major = v>>25; minor = (v>>15) & ((1<<10) -1); revision = v & ((1<<15) -1); }
34 template <
int major,
int minor,
int rel = 0>
struct wxMinimumVersion {
enum { eval = ((
unsigned int) Version<wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER>::eval >= (
unsigned int) Version<major, minor, rel>::eval) }; };
35 template <
int major,
int minor,
int rel = 0>
struct wxExactVersion {
enum { eval = ((
unsigned int) Version<wxMAJOR_VERSION, wxMINOR_VERSION, wxRELEASE_NUMBER>::eval == (
unsigned int) Version<major, minor, rel>::eval) }; };
54 template <
bool cond,
class true_t,
class false_t>
struct TernaryCondTypedef {
typedef true_t eval; };
55 template <
class true_t,
class false_t>
struct TernaryCondTypedef<false, true_t, false_t> {
typedef false_t eval; };
68 template <
typename T>
unsigned int array_size(
const T& array) {
enum {result =
sizeof(array) /
sizeof(array[0])};
return result; }
78 template<
typename T>
inline void Delete(T*& p){
delete p; p =
nullptr;}
79 template<
typename T>
inline void DeleteArray(T*& p){
delete[] p; p =
nullptr;}
124 #if ( wxUSE_UNICODE ) 125 const bool unicode =
true;
127 const bool unicode =
false;
130 #if defined ( __WIN32__ ) || defined ( _WIN64 ) 131 const identifier
id = platform_windows;
132 #elif defined ( __WXMAC__ ) || defined ( __WXCOCOA__ ) 133 const identifier
id = platform_macosx;
134 #elif defined ( __linux__ ) || defined ( LINUX ) 135 const identifier
id = platform_linux;
136 #elif defined ( FREEBSD ) || defined ( __FREEBSD__ ) 137 const identifier
id = platform_freebsd;
138 #elif defined ( NETBSD ) || defined ( __NETBSD__ ) 139 const identifier
id = platform_netbsd;
140 #elif defined ( OPENBSD ) || defined ( __OPENBSD__ ) 141 const identifier
id = platform_openbsd;
142 #elif defined ( DARWIN ) || defined ( __APPLE__ ) 143 const identifier
id = platform_darwin;
144 #elif defined(sun) || defined(__sun) 145 const identifier
id = platform_solaris;
147 const identifier
id = platform_unknown;
150 #if defined ( __WXGTK__ ) 151 const bool gtk =
true;
153 const bool gtk =
false;
156 #if defined ( __WXMAC__ ) 157 const bool carbon =
true;
159 const bool carbon =
false;
162 #if defined ( __WXCOCOA__ ) 163 const bool cocoa =
true;
165 const bool cocoa =
false;
168 const bool windows = (
id == platform_windows);
169 const bool macosx = (
id == platform_macosx);
170 const bool Linux = (
id == platform_linux);
171 const bool freebsd = (
id == platform_freebsd);
172 const bool netbsd = (
id == platform_netbsd);
173 const bool openbsd = (
id == platform_openbsd);
174 const bool darwin = (
id == platform_darwin);
175 const bool solaris = (
id == platform_solaris);
176 const bool Unix = (Linux | freebsd | netbsd | openbsd | darwin | solaris);
178 const int bits = 8*
sizeof(
void*);
222 #if defined(__GNUC__) && ((100 * __GNUC__ + 10 * __GNUC_MINOR__ + __GNUC_PATCHLEVEL__) >= 332) 223 const int gcc = Version<__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__>::eval;
224 #define cb_pure_function __attribute__ ((__pure__, __nothrow__)) 225 #define cb_const_function __attribute__ ((__const__, __nothrow__)) 226 #define cb_force_inline __attribute__ ((__always_inline__)) 227 #define cb_must_consume_result __attribute__ ((__warn_unused_result__)) 228 #define cb_deprecated_function __attribute__ ((__deprecated__)) 229 #define cb_unused __attribute__ ((__unused__)) 231 #if((100 * __GNUC__ + 10 *__GNUC_MINOR__ + __GNUC_PATCHLEVEL__) >= 436) 232 #define POISON(message) __attribute__((__error__(#message)) 234 #define POISON(message) 238 #define cb_pure_function 239 #define cb_const_function 240 #define cb_force_inline 241 #define cb_must_consume_result 242 #define cb_deprecated_function 244 #define POISON(message) 247 #define cb_optional cb_unused 257 const int version = Version<1>::eval;
258 const int buildsystem_version = Version<1>::eval;
259 const int plugin_api_version = Version<1,11,10>::eval;
273 namespace compatibility
275 #if defined(WXWIN_COMPATIBILITY_2_4) && defined(wxHIDE_READONLY) 276 const int wxHideReadonly = wxHIDE_READONLY;
278 const int wxHideReadonly = 0;
328 template<
typename>
friend ID GetID();
335 operator wxIntPtr()
const {
return value; };
336 operator void*()
const {
return reinterpret_cast<void*
>(
static_cast<uintptr_t
>(value)); };
338 bool Valid()
const {
return value != ((
wxIntPtr) -1); };
339 bool operator!()
const {
return !Valid(); };
341 friend bool operator==(
ID a,
ID b) {
return a.value == b.value; };
344 friend bool operator!=(
ID a,
ID b) {
return a.value != b.value; };
349 template<
typename whatever>
inline ID GetID()
355 inline ID GetID() {
return GetID<void>(); }
366 using std::shared_ptr;
367 using std::static_pointer_cast;
371 #if defined(__APPLE__) && defined(__MACH__) 372 #define CB_LIBRARY_ENVVAR _T("DYLD_LIBRARY_PATH") 373 #elif !defined(__WXMSW__) 374 #define CB_LIBRARY_ENVVAR _T("LD_LIBRARY_PATH") 376 #define CB_LIBRARY_ENVVAR _T("PATH")
void Delete(std::vector< T > &s)
bool operator==(wxString const &s, cbWatch const &w)
bool operator!=(const wxString &s1, const wxString &s2)