# pragma warning(disable:4003) /* not enough actual parameters for macro */
# endif
+ /*
+ When compiling with VC++ 7 /Wp64 option we get thousands of warnings for
+ conversion from size_t to int or long. Some precious few of them might
+ be worth looking into but unfortunately it seems infeasible to fix all
+ the other, harmless ones (e.g. inserting static_cast<int>(s.length())
+ everywhere this method is used though we are quite sure that using >4GB
+ strings is a bad idea anyhow) so just disable it globally for now.
+ */
+ #if wxCHECK_VISUALC_VERSION(7)
+ /* conversion from 'size_t' to 'unsigned long', possible loss of data */
+ #pragma warning(disable:4267)
+ #endif /* VC++ 7 or later */
+
/*
VC++ 8 gives a warning when using standard functions such as sprintf,
localtime, ... -- stop this madness, unless the user had already done it
*/
- #if __VISUALC__ >= 1400
+ #if wxCHECK_VISUALC_VERSION(8)
#ifndef _CRT_SECURE_NO_DEPRECATE
#define _CRT_SECURE_NO_DEPRECATE 1
#endif
#endif /* VC++ 8 */
#endif /* __VISUALC__ */
-/* suppress some Salford C++ warnings */
-#ifdef __SALFORDC__
-# pragma suppress 353 /* Possible nested comments */
-# pragma suppress 593 /* Define not used */
-# pragma suppress 61 /* enum has no name (doesn't suppress!) */
-# pragma suppress 106 /* unnamed, unused parameter */
-# pragma suppress 571 /* Virtual function hiding */
-#endif /* __SALFORDC__ */
-
/* suppress some Borland C++ warnings */
#ifdef __BORLANDC__
# pragma warn -inl /* Functions containing reserved words and certain constructs are not expanded inline */
typedef short int WXTYPE;
-/* special care should be taken with this type under Windows where the real */
-/* window id is unsigned, so we must always do the cast before comparing them */
-/* (or else they would be always different!). Using wxGetWindowId() which does */
-/* the cast itself is recommended. Note that this type can't be unsigned */
-/* because wxID_ANY == -1 is a valid (and largely used) value for window id. */
-typedef int wxWindowID;
/* ---------------------------------------------------------------------------- */
/* other feature tests */
#endif
#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__
+
/* ---------------------------------------------------------------------------- */
/* portable calling conventions macros */
/* ---------------------------------------------------------------------------- */
#define wxINT64_MIN LLONG_MIN
#else
#define wxINT64_MAX wxLL(9223372036854775807)
- #define wxINT64_MIN wxLL(-9223372036854775807-1)
+ #define wxINT64_MIN (wxLL(-9223372036854775807)-1)
#endif
/*
Define an integral type big enough to contain all of long, size_t and void *.
*/
-#if SIZEOF_LONG >= SIZEOF_VOID_P && SIZEOF_LONG >= SIZEOF_SIZE_T
- /* normal case */
- typedef unsigned long wxUIntPtr;
-#elif SIZEOF_SIZE_T >= SIZEOF_VOID_P
- /* Win64 case */
+#if SIZEOF_SIZE_T >= SIZEOF_VOID_P
+ /*
+ Win64 case: size_t is the only integral type big enough for "void *".
+
+ Notice that wxUIntPtr should be also defined as size_t when building
+ under Win32 with MSVC with /Wp64 option as otherwise any conversion
+ between ints and pointers results in a warning 4311 or 4312, even if it
+ is safe under Win32. Using size_t (declared with __w64) allows to avoid
+ them.
+ */
typedef size_t wxUIntPtr;
+#elif SIZEOF_LONG >= SIZEOF_VOID_P
+ /*
+ Normal case when long is the largest integral type.
+ */
+ typedef unsigned long wxUIntPtr;
#else
/*
This should never happen for the current architectures but if you're
These ids delimit the range used by automatically-generated ids
(i.e. those used when wxID_ANY is specified during construction).
*/
+#if defined(__WXMSW__) || wxUSE_AUTOID_MANAGEMENT
+ /*
+ On MSW the range is always restricted no matter if id management
+ is used or not because the native window ids are limited to short
+ range. On other platforms the range is only restricted if id
+ management is used so the reference count buffer won't be so big.
+ */
wxID_AUTO_LOWEST = -32000,
wxID_AUTO_HIGHEST = -2000,
+#else
+ wxID_AUTO_LOWEST = -1000000,
+ wxID_AUTO_HIGHEST = -2000,
+#endif
/* no id matches this one when compared to it */
wxID_NONE = -3,
wxID_HIGHEST = 5999
};
+/* ---------------------------------------------------------------------------- */
+/* wxWindowID type (after wxID_XYZ enum, platform detection, and dlimpexp.h) */
+/* ---------------------------------------------------------------------------- */
+
+/* special care should be taken with this type under Windows where the real */
+/* window id is unsigned, so we must always do the cast before comparing them */
+/* (or else they would be always different!). Using wxGetWindowId() which does */
+/* the cast itself is recommended. Note that this type can't be unsigned */
+/* because wxID_ANY == -1 is a valid (and largely used) value for window id. */
+#ifdef __cplusplus
+ #include "wx/windowid.h"
+#endif
+
/* ---------------------------------------------------------------------------- */
/* other constants */
/* ---------------------------------------------------------------------------- */