X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/8fde61ed10b121a1e9dc0a31e2ce8562c4066a09..1de4baa31f17548b32a376a71ce50fee6a3e759c:/include/wx/defs.h diff --git a/include/wx/defs.h b/include/wx/defs.h index 537a7f5ad9..cf9dd6d064 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -12,7 +12,7 @@ #ifndef _WX_DEFS_H_ #define _WX_DEFS_H_ -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(__APPLE__) #pragma interface "defs.h" #endif @@ -210,7 +210,7 @@ typedef short int WXTYPE; // window id is unsigned, so we must always do the cast before comparing them // (or else they would be always different!). Usign wxGetWindowId() which does // the cast itself is recommended. Note that this type can't be unsigned -// because -1 is a valid (and largely used) value for window id. +// because wxID_ANY == -1 is a valid (and largely used) value for window id. typedef int wxWindowID; // ---------------------------------------------------------------------------- @@ -229,12 +229,29 @@ typedef int wxWindowID; #define wxUSE_NESTED_CLASSES 0 #endif +// check for explicit keyword support +#ifndef HAVE_EXPLICIT + // VC++ 6.0 has explicit (what about the earlier versions?) + #if defined(__VISUALC__) && (__VISUALC__ > 1200) + #define HAVE_EXPLICIT + // Metrowerks CW6 or higher has explicit + #elif defined(__MWERKS__) && (__MWERKS__ >= 0x2400) + #define HAVE_EXPLICIT + #endif +#endif // !HAVE_EXPLICIT + +#ifdef HAVE_EXPLICIT + #define wxEXPLICIT explicit +#else // !HAVE_EXPLICIT + #define wxEXPLICIT +#endif // HAVE_EXPLICIT/!HAVE_EXPLICIT + // ---------------------------------------------------------------------------- // portable calling conventions macros // ---------------------------------------------------------------------------- // stdcall is used for all functions called by Windows under Windows -#ifdef __WINDOWS__ +#if defined(__WINDOWS__) && !defined(__WXWINE__) #if defined(__GNUWIN32__) #define wxSTDCALL __attribute__((stdcall)) #else @@ -350,6 +367,27 @@ class WXDLLEXPORT wxEvent; // Very common macros // ---------------------------------------------------------------------------- +// Printf-like attribute definitions to obtain warnings with GNU C/C++ +#if defined(__GNUC__) && !wxUSE_UNICODE +# ifndef ATTRIBUTE_PRINTF +# define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) +# define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2) +# define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3) +# define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4) +# define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5) +# define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6) +# endif /* ATTRIBUTE_PRINTF */ +#else +# ifndef ATTRIBUTE_PRINTF +# define ATTRIBUTE_PRINTF +# define ATTRIBUTE_PRINTF_1 +# define ATTRIBUTE_PRINTF_2 +# define ATTRIBUTE_PRINTF_3 +# define ATTRIBUTE_PRINTF_4 +# define ATTRIBUTE_PRINTF_5 +# endif /* ATTRIBUTE_PRINTF */ +#endif + // everybody gets the assert and other debug macros #ifdef __cplusplus #include "wx/debug.h" @@ -427,27 +465,6 @@ class WXDLLEXPORT wxEvent; typedef void (*wxFunction) (wxObject&, wxEvent&); #endif -// Printf-like attribute definitions to obtain warnings with GNU C/C++ -#if defined(__GNUC__) && !wxUSE_UNICODE -# ifndef ATTRIBUTE_PRINTF -# define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) -# define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2) -# define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3) -# define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4) -# define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5) -# define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6) -# endif /* ATTRIBUTE_PRINTF */ -#else -# ifndef ATTRIBUTE_PRINTF -# define ATTRIBUTE_PRINTF -# define ATTRIBUTE_PRINTF_1 -# define ATTRIBUTE_PRINTF_2 -# define ATTRIBUTE_PRINTF_3 -# define ATTRIBUTE_PRINTF_4 -# define ATTRIBUTE_PRINTF_5 -# endif /* ATTRIBUTE_PRINTF */ -#endif - // ---------------------------------------------------------------------------- // OS mnemonics -- Identify the running OS (useful for Windows) // ---------------------------------------------------------------------------- @@ -1768,7 +1785,7 @@ enum wxPrintMode // ---------------------------------------------------------------------------- // define this macro if font handling is done using the X font names -#if defined(__WXGTK__) || defined(__X__) +#if (defined(__WXGTK__) && !defined(__WXGTK20__)) || defined(__X__) #define _WX_X_FONTLIKE #endif