renamed ATTRIBUTE_PRINTF to WX_ATTRIBUTE_PRINTF to avoid naming conflicts (e.g. with latest libxml2)

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@59479 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2009-03-11 07:51:38 +00:00
parent a4e3249255
commit 862bb5c73a
5 changed files with 17 additions and 17 deletions

View File

@@ -474,19 +474,19 @@ typedef short int WXTYPE;
/* ---------------------------------------------------------------------------- */ /* ---------------------------------------------------------------------------- */
/* Printf-like attribute definitions to obtain warnings with GNU C/C++ */ /* Printf-like attribute definitions to obtain warnings with GNU C/C++ */
#ifndef ATTRIBUTE_PRINTF #ifndef WX_ATTRIBUTE_PRINTF
# if defined(__GNUC__) && !wxUSE_UNICODE # if defined(__GNUC__) && !wxUSE_UNICODE
# define ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n))) # define WX_ATTRIBUTE_PRINTF(m, n) __attribute__ ((__format__ (__printf__, m, n)))
# else # else
# define ATTRIBUTE_PRINTF(m, n) # define WX_ATTRIBUTE_PRINTF(m, n)
# endif # endif
# define ATTRIBUTE_PRINTF_1 ATTRIBUTE_PRINTF(1, 2) # define WX_ATTRIBUTE_PRINTF_1 WX_ATTRIBUTE_PRINTF(1, 2)
# define ATTRIBUTE_PRINTF_2 ATTRIBUTE_PRINTF(2, 3) # define WX_ATTRIBUTE_PRINTF_2 WX_ATTRIBUTE_PRINTF(2, 3)
# define ATTRIBUTE_PRINTF_3 ATTRIBUTE_PRINTF(3, 4) # define WX_ATTRIBUTE_PRINTF_3 WX_ATTRIBUTE_PRINTF(3, 4)
# define ATTRIBUTE_PRINTF_4 ATTRIBUTE_PRINTF(4, 5) # define WX_ATTRIBUTE_PRINTF_4 WX_ATTRIBUTE_PRINTF(4, 5)
# define ATTRIBUTE_PRINTF_5 ATTRIBUTE_PRINTF(5, 6) # define WX_ATTRIBUTE_PRINTF_5 WX_ATTRIBUTE_PRINTF(5, 6)
#endif /* !defined(ATTRIBUTE_PRINTF) */ #endif /* !defined(WX_ATTRIBUTE_PRINTF) */
/* Macro to issue warning when using deprecated functions with gcc3 or MSVC7: */ /* Macro to issue warning when using deprecated functions with gcc3 or MSVC7: */

View File

@@ -351,8 +351,8 @@ static wxDebugContextDumpDelayCounter wxDebugContextDumpDelayCounter_File;
static wxDebugContextDumpDelayCounter wxDebugContextDumpDelayCounter_Extra; static wxDebugContextDumpDelayCounter wxDebugContextDumpDelayCounter_Extra;
// Output a debug message, in a system dependent fashion. // Output a debug message, in a system dependent fashion.
void WXDLLIMPEXP_BASE wxTrace(const wxChar *fmt ...) ATTRIBUTE_PRINTF_1; void WXDLLIMPEXP_BASE wxTrace(const wxChar *fmt ...) WX_ATTRIBUTE_PRINTF_1;
void WXDLLIMPEXP_BASE wxTraceLevel(int level, const wxChar *fmt ...) ATTRIBUTE_PRINTF_2; void WXDLLIMPEXP_BASE wxTraceLevel(int level, const wxChar *fmt ...) WX_ATTRIBUTE_PRINTF_2;
#define WXTRACE wxTrace #define WXTRACE wxTrace
#define WXTRACELEVEL wxTraceLevel #define WXTRACELEVEL wxTraceLevel

View File

@@ -350,7 +350,7 @@ public:
// these are duplicated wxString methods, they're also declared below // these are duplicated wxString methods, they're also declared below
// if !wxNEEDS_WXSTRING_PRINTF_MIXIN: // if !wxNEEDS_WXSTRING_PRINTF_MIXIN:
// static wxString Format(const wString& format, ...) ATTRIBUTE_PRINTF_1; // static wxString Format(const wString& format, ...) WX_ATTRIBUTE_PRINTF_1;
WX_DEFINE_VARARG_FUNC_SANS_N0(static typename StringReturnType<T1>::type, WX_DEFINE_VARARG_FUNC_SANS_N0(static typename StringReturnType<T1>::type,
Format, 1, (const wxFormatString&), Format, 1, (const wxFormatString&),
DoFormatWchar, DoFormatUtf8) DoFormatWchar, DoFormatUtf8)
@@ -372,7 +372,7 @@ public:
// int Printf(const wxString& format, ...); // int Printf(const wxString& format, ...);
WX_DEFINE_VARARG_FUNC(int, Printf, 1, (const wxFormatString&), WX_DEFINE_VARARG_FUNC(int, Printf, 1, (const wxFormatString&),
DoPrintfWchar, DoPrintfUtf8) DoPrintfWchar, DoPrintfUtf8)
// int sprintf(const wxString& format, ...) ATTRIBUTE_PRINTF_2; // int sprintf(const wxString& format, ...) WX_ATTRIBUTE_PRINTF_2;
WX_DEFINE_VARARG_FUNC(int, sprintf, 1, (const wxFormatString&), WX_DEFINE_VARARG_FUNC(int, sprintf, 1, (const wxFormatString&),
DoPrintfWchar, DoPrintfUtf8) DoPrintfWchar, DoPrintfUtf8)
@@ -2245,7 +2245,7 @@ public:
#ifndef wxNEEDS_WXSTRING_PRINTF_MIXIN #ifndef wxNEEDS_WXSTRING_PRINTF_MIXIN
// returns the string containing the result of Printf() to it // returns the string containing the result of Printf() to it
// static wxString Format(const wxString& format, ...) ATTRIBUTE_PRINTF_1; // static wxString Format(const wxString& format, ...) WX_ATTRIBUTE_PRINTF_1;
WX_DEFINE_VARARG_FUNC(static wxString, Format, 1, (const wxFormatString&), WX_DEFINE_VARARG_FUNC(static wxString, Format, 1, (const wxFormatString&),
DoFormatWchar, DoFormatUtf8) DoFormatWchar, DoFormatUtf8)
#ifdef __WATCOMC__ #ifdef __WATCOMC__
@@ -2294,7 +2294,7 @@ public:
#ifndef wxNEEDS_WXSTRING_PRINTF_MIXIN #ifndef wxNEEDS_WXSTRING_PRINTF_MIXIN
// use Printf() // use Printf()
// (take 'this' into account in attribute parameter count) // (take 'this' into account in attribute parameter count)
// int sprintf(const wxString& format, ...) ATTRIBUTE_PRINTF_2; // int sprintf(const wxString& format, ...) WX_ATTRIBUTE_PRINTF_2;
WX_DEFINE_VARARG_FUNC(int, sprintf, 1, (const wxFormatString&), WX_DEFINE_VARARG_FUNC(int, sprintf, 1, (const wxFormatString&),
DoPrintfWchar, DoPrintfUtf8) DoPrintfWchar, DoPrintfUtf8)
#ifdef __WATCOMC__ #ifdef __WATCOMC__

View File

@@ -1760,7 +1760,7 @@ static void TestRegExInteractive()
#undef wxPrintf #undef wxPrintf
#undef wxSprintf #undef wxSprintf
// NB: do _not_ use ATTRIBUTE_PRINTF here, we have some invalid formats // NB: do _not_ use WX_ATTRIBUTE_PRINTF here, we have some invalid formats
// in the tests below // in the tests below
int wxPrintf( const wxChar *format, ... ); int wxPrintf( const wxChar *format, ... );
int wxSprintf( wxChar *str, const wxChar *format, ... ); int wxSprintf( wxChar *str, const wxChar *format, ... );

View File

@@ -90,7 +90,7 @@ int r;
wxString(buffer)) wxString(buffer))
// this is the same as wxSnprintf() but it passes the format string to // this is the same as wxSnprintf() but it passes the format string to
// wxVsnprintf() without using ATTRIBUTE_PRINTF and thus suppresses the gcc // wxVsnprintf() without using WX_ATTRIBUTE_PRINTF and thus suppresses the gcc
// checks (and resulting warnings) for the format string // checks (and resulting warnings) for the format string
// //
// use with extreme care and only when you're really sure the warnings must be // use with extreme care and only when you're really sure the warnings must be