From 862bb5c73a2577e356f2fece32f55d785c79e517 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?V=C3=A1clav=20Slav=C3=ADk?= Date: Wed, 11 Mar 2009 07:51:38 +0000 Subject: [PATCH] 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 --- include/wx/defs.h | 18 +++++++++--------- include/wx/memory.h | 4 ++-- include/wx/string.h | 8 ++++---- samples/console/console.cpp | 2 +- tests/strings/vsnprintf.cpp | 2 +- 5 files changed, 17 insertions(+), 17 deletions(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index 64bd994a80..a1877264a9 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -474,19 +474,19 @@ typedef short int WXTYPE; /* ---------------------------------------------------------------------------- */ /* Printf-like attribute definitions to obtain warnings with GNU C/C++ */ -#ifndef ATTRIBUTE_PRINTF +#ifndef WX_ATTRIBUTE_PRINTF # 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 -# define ATTRIBUTE_PRINTF(m, n) +# define WX_ATTRIBUTE_PRINTF(m, n) # endif -# 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 /* !defined(ATTRIBUTE_PRINTF) */ +# 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: */ diff --git a/include/wx/memory.h b/include/wx/memory.h index 3291e38eb6..23b1a01ef0 100644 --- a/include/wx/memory.h +++ b/include/wx/memory.h @@ -351,8 +351,8 @@ static wxDebugContextDumpDelayCounter wxDebugContextDumpDelayCounter_File; static wxDebugContextDumpDelayCounter wxDebugContextDumpDelayCounter_Extra; // Output a debug message, in a system dependent fashion. -void WXDLLIMPEXP_BASE wxTrace(const wxChar *fmt ...) ATTRIBUTE_PRINTF_1; -void WXDLLIMPEXP_BASE wxTraceLevel(int level, const wxChar *fmt ...) ATTRIBUTE_PRINTF_2; +void WXDLLIMPEXP_BASE wxTrace(const wxChar *fmt ...) WX_ATTRIBUTE_PRINTF_1; +void WXDLLIMPEXP_BASE wxTraceLevel(int level, const wxChar *fmt ...) WX_ATTRIBUTE_PRINTF_2; #define WXTRACE wxTrace #define WXTRACELEVEL wxTraceLevel diff --git a/include/wx/string.h b/include/wx/string.h index b6cb7836b3..bdba1d23cf 100644 --- a/include/wx/string.h +++ b/include/wx/string.h @@ -350,7 +350,7 @@ public: // these are duplicated wxString methods, they're also declared below // 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::type, Format, 1, (const wxFormatString&), DoFormatWchar, DoFormatUtf8) @@ -372,7 +372,7 @@ public: // int Printf(const wxString& format, ...); WX_DEFINE_VARARG_FUNC(int, Printf, 1, (const wxFormatString&), 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&), DoPrintfWchar, DoPrintfUtf8) @@ -2245,7 +2245,7 @@ public: #ifndef wxNEEDS_WXSTRING_PRINTF_MIXIN // 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&), DoFormatWchar, DoFormatUtf8) #ifdef __WATCOMC__ @@ -2294,7 +2294,7 @@ public: #ifndef wxNEEDS_WXSTRING_PRINTF_MIXIN // use Printf() // (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&), DoPrintfWchar, DoPrintfUtf8) #ifdef __WATCOMC__ diff --git a/samples/console/console.cpp b/samples/console/console.cpp index a1af04971c..3dc7031200 100644 --- a/samples/console/console.cpp +++ b/samples/console/console.cpp @@ -1760,7 +1760,7 @@ static void TestRegExInteractive() #undef wxPrintf #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 int wxPrintf( const wxChar *format, ... ); int wxSprintf( wxChar *str, const wxChar *format, ... ); diff --git a/tests/strings/vsnprintf.cpp b/tests/strings/vsnprintf.cpp index d6640ef0d1..8353178303 100644 --- a/tests/strings/vsnprintf.cpp +++ b/tests/strings/vsnprintf.cpp @@ -90,7 +90,7 @@ int r; wxString(buffer)) // 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 // // use with extreme care and only when you're really sure the warnings must be