+/* ---------------------------------------------------------------------------- */
+/* wxWidgets version and compatibility defines */
+/* ---------------------------------------------------------------------------- */
+
+#include "wx/version.h"
+
+/* ============================================================================ */
+/* non portable C++ features */
+/* ============================================================================ */
+
+/* ---------------------------------------------------------------------------- */
+/* compiler defects workarounds */
+/* ---------------------------------------------------------------------------- */
+
+/*
+ Digital Unix C++ compiler only defines this symbol for .cxx and .hxx files,
+ so define it ourselves (newer versions do it for all files, though, and
+ don't allow it to be redefined)
+ */
+#if defined(__DECCXX) && !defined(__VMS) && !defined(__cplusplus)
+#define __cplusplus
+#endif /* __DECCXX */
+
+/* Resolves linking problems under HP-UX when compiling with gcc/g++ */
+#if defined(__HPUX__) && defined(__GNUG__)
+#define va_list __gnuc_va_list
+#endif /* HP-UX */
+
+/* Prevents conflicts between sys/types.h and winsock.h with Cygwin, */
+/* when using Windows sockets. */
+#ifdef __CYGWIN__
+#define __USE_W32_SOCKETS
+#endif
+
+/* ---------------------------------------------------------------------------- */
+/* check for native bool type and TRUE/FALSE constants */
+/* ---------------------------------------------------------------------------- */
+
+/* for backwards compatibility, also define TRUE and FALSE */
+/* */
+/* note that these definitions should work both in C++ and C code, so don't */
+/* use true/false below */
+#ifndef TRUE
+ #define TRUE 1
+#endif
+
+#ifndef FALSE
+ #define FALSE 0
+#endif
+
+typedef short int WXTYPE;
+
+
+/* ---------------------------------------------------------------------------- */
+/* other feature tests */
+/* ---------------------------------------------------------------------------- */
+
+/* Every ride down a slippery slope begins with a single step.. */
+/* */
+/* Yes, using nested classes is indeed against our coding standards in */
+/* general, but there are places where you can use them to advantage */
+/* without totally breaking ports that cannot use them. If you do, then */
+/* wrap it in this guard, but such cases should still be relatively rare. */
+#define wxUSE_NESTED_CLASSES 1
+
+/* check for explicit keyword support */
+#ifndef HAVE_EXPLICIT
+ #if defined(__VISUALC__) && (__VISUALC__ >= 1100)
+ /* VC++ 6.0 and 5.0 have explicit (what about earlier versions?) */
+ #define HAVE_EXPLICIT
+ #elif ( defined(__MINGW32__) || defined(__CYGWIN32__) ) \
+ && wxCHECK_GCC_VERSION(2, 95)
+ /* GCC 2.95 has explicit, what about earlier versions? */
+ #define HAVE_EXPLICIT
+ #elif defined(__BORLANDC__) && (__BORLANDC__ >= 0x0520)
+ /* BC++ 4.52 doesn't support explicit, CBuilder 1 does */
+ #define HAVE_EXPLICIT
+ #elif defined(__MWERKS__) && (__MWERKS__ >= 0x2400)
+ /* Metrowerks CW6 or higher has explicit */
+ #define HAVE_EXPLICIT
+ #elif defined(__DIGITALMARS__)
+ #define HAVE_EXPLICIT
+ #elif defined(__WATCOMC__)
+ #define HAVE_EXPLICIT
+ #endif
+#endif /* !HAVE_EXPLICIT */
+
+#ifdef HAVE_EXPLICIT
+ #define wxEXPLICIT explicit
+#else /* !HAVE_EXPLICIT */
+ #define wxEXPLICIT
+#endif /* HAVE_EXPLICIT/!HAVE_EXPLICIT */
+
+/* these macros are obsolete, use the standard C++ casts directly now */
+#define wx_static_cast(t, x) static_cast<t>(x)
+#define wx_const_cast(t, x) const_cast<t>(x)
+#define wx_reinterpret_cast(t, x) reinterpret_cast<t>(x)
+
+/*
+ This one is a wx invention: like static cast but used when we intentionally
+ truncate from a larger to smaller type, static_cast<> can't be used for it
+ as it results in warnings when using some compilers (SGI mipspro for example)
+ */
+#if defined(__INTELC__) && defined(__cplusplus)
+ template <typename T, typename X>
+ inline T wx_truncate_cast_impl(X x)
+ {
+ #pragma warning(push)
+ /* implicit conversion of a 64-bit integral type to a smaller integral type */
+ #pragma warning(disable: 1682)
+ /* conversion from "X" to "T" may lose significant bits */
+ #pragma warning(disable: 810)
+ /* non-pointer conversion from "foo" to "bar" may lose significant bits */
+ #pragma warning(disable: 2259)
+
+ return x;
+
+ #pragma warning(pop)
+ }
+
+ #define wx_truncate_cast(t, x) wx_truncate_cast_impl<t>(x)
+
+#elif defined(__cplusplus) && defined(__VISUALC__) && __VISUALC__ >= 1310
+ template <typename T, typename X>
+ inline T wx_truncate_cast_impl(X x)
+ {
+ #pragma warning(push)
+ /* conversion from 'X' to 'T', possible loss of data */
+ #pragma warning(disable: 4267)
+
+ return x;
+
+ #pragma warning(pop)
+ }
+
+ #define wx_truncate_cast(t, x) wx_truncate_cast_impl<t>(x)
+#else
+ #define wx_truncate_cast(t, x) ((t)(x))
+#endif
+
+/* for consistency with wxStatic/DynamicCast defined in wx/object.h */
+#define wxConstCast(obj, className) wx_const_cast(className *, obj)
+
+#ifndef HAVE_STD_WSTRING
+ #if defined(__VISUALC__) && (__VISUALC__ >= 1100)
+ /* VC++ 6.0 and 5.0 have std::wstring (what about earlier versions?) */
+ #define HAVE_STD_WSTRING
+ #elif defined(__MINGW32__) && wxCHECK_GCC_VERSION(3, 3)
+ /* GCC 3.1 has std::wstring; 3.0 never was in MinGW, 2.95 hasn't it */
+ #define HAVE_STD_WSTRING
+ #endif
+#endif
+
+#ifndef HAVE_STD_STRING_COMPARE
+ #if defined(__VISUALC__) && (__VISUALC__ >= 1100)
+ /* VC++ 6.0 and 5.0 have std::string::compare */
+ /* (what about earlier versions?) */
+ #define HAVE_STD_STRING_COMPARE
+ #elif ( defined(__MINGW32__) || defined(__CYGWIN32__) ) \
+ && wxCHECK_GCC_VERSION(3, 1)
+ /* GCC 3.1 has std::string::compare; */
+ /* 3.0 never was in MinGW, 2.95 hasn't it */
+ #define HAVE_STD_STRING_COMPARE
+ #endif
+#endif
+
+#ifndef HAVE_TR1_TYPE_TRAITS
+ #if defined(__VISUALC__) && (_MSC_FULL_VER >= 150030729)
+ #define HAVE_TR1_TYPE_TRAITS
+ #endif
+#endif
+
+/* provide replacement for C99 va_copy() if the compiler doesn't have it */
+
+/* could be already defined by configure or the user */
+#ifndef wxVaCopy
+ /* if va_copy is a macro or configure detected that we have it, use it */
+ #if defined(va_copy) || defined(HAVE_VA_COPY)
+ #define wxVaCopy va_copy
+ #else /* no va_copy, try to provide a replacement */
+ /*
+ configure tries to determine whether va_list is an array or struct
+ type, but it may not be used under Windows, so deal with a few
+ special cases.
+ */
+
+ #ifdef __WATCOMC__
+ /* Watcom uses array type for va_list except for PPC and Alpha */
+ #if !defined(__PPC__) && !defined(__AXP__)
+ #define VA_LIST_IS_ARRAY
+ #endif
+ #endif /* __WATCOMC__ */
+
+ #if defined(__PPC__) && (defined(_CALL_SYSV) || defined (_WIN32))
+ /*
+ PPC using SysV ABI and NT/PPC are special in that they use an
+ extra level of indirection.
+ */
+ #define VA_LIST_IS_POINTER
+ #endif /* SysV or Win32 on __PPC__ */
+
+ /*
+ note that we use memmove(), not memcpy(), in case anybody tries
+ to do wxVaCopy(ap, ap)
+ */
+ #if defined(VA_LIST_IS_POINTER)
+ #define wxVaCopy(d, s) memmove(*(d), *(s), sizeof(va_list))
+ #elif defined(VA_LIST_IS_ARRAY)
+ #define wxVaCopy(d, s) memmove((d), (s), sizeof(va_list))
+ #else /* we can only hope that va_lists are simple lvalues */
+ #define wxVaCopy(d, s) ((d) = (s))
+ #endif
+ #endif /* va_copy/!va_copy */
+#endif /* wxVaCopy */
+
+#ifndef HAVE_VARIADIC_MACROS
+ #if wxCHECK_WATCOM_VERSION(1,2)
+ #define HAVE_VARIADIC_MACROS
+ #endif
+#endif /* HAVE_VARIADIC_MACROS */
+
+
+#ifndef HAVE_WOSTREAM
+ /*
+ Mingw <= 3.4 and all versions of Cygwin as well as any gcc version (so
+ far) targeting PalmOS don't have std::wostream
+ */
+ #if defined(__PALMOS__) || \
+ (defined(__MINGW32__) && !wxCHECK_GCC_VERSION(4, 0)) || \
+ defined(__CYGWIN__)
+ #define wxNO_WOSTREAM
+ #endif
+
+ /* VC++ doesn't have it in the old iostream library */
+ #if defined(__VISUALC__) && wxUSE_IOSTREAMH
+ #define wxNO_WOSTREAM
+ #endif
+
+ #ifndef wxNO_WOSTREAM
+ #define HAVE_WOSTREAM
+ #endif
+
+ #undef wxNO_WOSTREAM
+#endif /* HAVE_WOSTREAM */
+
+/* ---------------------------------------------------------------------------- */
+/* other C++ features */
+/* ---------------------------------------------------------------------------- */
+
+#ifndef HAVE_PARTIAL_SPECIALIZATION
+ /* be optimistic by default */
+ #define HAVE_PARTIAL_SPECIALIZATION
+#endif
+
+#ifdef __VISUALC__
+ #if __VISUALC__ < 1310
+ #undef HAVE_PARTIAL_SPECIALIZATION
+ #endif
+#endif /* __VISUALC__ */
+
+
+#ifndef HAVE_TEMPLATE_OVERLOAD_RESOLUTION
+ /* assume the compiler can use type or const expressions as template
+ arguments if it supports partial specialization -- except if it's a
+ Borland one which can't */
+ #if defined(HAVE_PARTIAL_SPECIALIZATION) && !defined(__BORLANDC__)
+ #define HAVE_TEMPLATE_OVERLOAD_RESOLUTION
+ #endif /* (HAVE_PARTIAL_SPECIALIZATION) && !defined(__BORLANDC__) */
+#endif /* !defined(HAVE_TEMPLATE_OVERLOAD_RESOLUTION) */
+
+/* ---------------------------------------------------------------------------- */
+/* portable calling conventions macros */
+/* ---------------------------------------------------------------------------- */
+
+/* stdcall is used for all functions called by Windows under Windows */
+#if defined(__WINDOWS__)
+ #if defined(__GNUWIN32__)
+ #define wxSTDCALL __attribute__((stdcall))
+ #else
+ /* both VC++ and Borland understand this */
+ #define wxSTDCALL _stdcall
+ #endif
+
+#else /* Win */
+ /* no such stupidness under Unix */
+ #define wxSTDCALL
+#endif /* platform */
+
+/* LINKAGEMODE mode is empty for everyting except OS/2 */
+#ifndef LINKAGEMODE
+ #define LINKAGEMODE
+#endif /* LINKAGEMODE */
+
+/* wxCALLBACK should be used for the functions which are called back by */
+/* Windows (such as compare function for wxListCtrl) */
+#if defined(__WIN32__) && !defined(__WXMICROWIN__)
+ #define wxCALLBACK wxSTDCALL
+#else
+ /* no stdcall under Unix nor Win16 */
+ #define wxCALLBACK
+#endif /* platform */
+
+/* generic calling convention for the extern "C" functions */
+
+#if defined(__VISUALC__)
+ #define wxC_CALLING_CONV _cdecl
+#elif defined(__VISAGECPP__)
+ #define wxC_CALLING_CONV _Optlink
+#else /* !Visual C++ */
+ #define wxC_CALLING_CONV
+#endif /* compiler */
+
+/* callling convention for the qsort(3) callback */
+#define wxCMPFUNC_CONV wxC_CALLING_CONV
+
+/* compatibility :-( */
+#define CMPFUNC_CONV wxCMPFUNC_CONV
+
+/* DLL import/export declarations */
+#include "wx/dlimpexp.h"
+
+/* ---------------------------------------------------------------------------- */
+/* Very common macros */
+/* ---------------------------------------------------------------------------- */
+
+/* Printf-like attribute definitions to obtain warnings with GNU C/C++ */
+#ifndef WX_ATTRIBUTE_PRINTF
+# if defined(__GNUC__) && !wxUSE_UNICODE
+# define WX_ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
+# else
+# define WX_ATTRIBUTE_PRINTF(m, n)
+# endif
+
+# define WX_ATTRIBUTE_PRINTF_1 WX_ATTRIBUTE_PRINTF(1, 2)
+# define WX_ATTRIBUTE_PRINTF_2 WX_ATTRIBUTE_PRINTF(2, 3)
+# define WX_ATTRIBUTE_PRINTF_3 WX_ATTRIBUTE_PRINTF(3, 4)
+# define WX_ATTRIBUTE_PRINTF_4 WX_ATTRIBUTE_PRINTF(4, 5)
+# define WX_ATTRIBUTE_PRINTF_5 WX_ATTRIBUTE_PRINTF(5, 6)
+#endif /* !defined(WX_ATTRIBUTE_PRINTF) */
+
+
+/* Macro to issue warning when using deprecated functions with gcc3 or MSVC7: */
+#if wxCHECK_GCC_VERSION(3, 1)
+ #define wxDEPRECATED(x) __attribute__((deprecated)) x
+#elif defined(__VISUALC__) && (__VISUALC__ >= 1300)
+ #define wxDEPRECATED(x) __declspec(deprecated) x
+#else
+ #define wxDEPRECATED(x) x
+#endif
+
+/*
+ explicitly specifying inline allows gcc < 3.4 to
+ handle the deprecation attribute even in the constructor.
+ doesn't seem to work on Apple's gcc 4.0.1 unless using -O0
+*/
+#if wxCHECK_GCC_VERSION(3, 4) || defined( __DARWIN__ )
+ #define wxDEPRECATED_CONSTRUCTOR(x) x
+#else
+ #define wxDEPRECATED_CONSTRUCTOR(x) wxDEPRECATED( inline x)
+#endif