From 3694bb76c11d1ed1518f20a42f8907c948e190bd Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Fri, 21 Sep 2007 12:34:32 +0000
Subject: [PATCH] added wxDEPRECATED_INLINE, use it for
 wxPixelData<wxBitmap>::UseAlpha() to fix Sun CC compilation

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@48866 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/latex/wx/function.tex | 20 ++++++++++++++++++++
 include/wx/defs.h          |  3 +++
 include/wx/rawbmp.h        |  8 +-------
 3 files changed, 24 insertions(+), 7 deletions(-)

diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex
index d47a983c0e..62e622480a 100644
--- a/docs/latex/wx/function.tex
+++ b/docs/latex/wx/function.tex
@@ -76,6 +76,7 @@ the corresponding topic.
 \helpref{WXDEBUG\_NEW}{debugnew}\\
 \helpref{wxDEPRECATED}{wxdeprecated}\\
 \helpref{wxDEPRECATED\_BUT\_USED\_INTERNALLY}{wxdeprecatedbutusedinternally}\\
+\helpref{wxDEPRECATED\_INLINE}{wxdeprecatedinline}\\
 \helpref{wxDirExists}{functionwxdirexists}\\
 \helpref{wxDirSelector}{wxdirselector}\\
 \helpref{wxDisplayDepth}{wxdisplaydepth}\\
@@ -3008,6 +3009,25 @@ used from the user code or, in case of Visual C++, even when it is simply
 overridden.
 
 
+\membersection{wxDEPRECATED\_INLINE}\label{wxdeprecatedinline}
+
+\func{}{wxDEPRECATED\_INLINE}{\param{}{func}, \param{}{body}}
+
+This macro is similar to \helpref{wxDEPRECATED}{wxdeprecated} but can be used
+to not only declare the function \arg{func} as deprecated but to also provide
+its (inline) implementation \arg{body}.
+
+It can be used as following:
+\begin{verbatim}
+    class wxFoo
+    {
+    public:
+        // OldMethod() is deprecated, use NewMethod() instead
+        void NewMethod();
+        wxDEPRECATED_INLINE( void OldMethod(), NewMethod() );
+    };
+\end{verbatim}
+
 \membersection{wxEXPLICIT}\label{wxexplicit}
 
 {\tt wxEXPLICIT} is a macro which expands to the C++ {\tt explicit} keyword if
diff --git a/include/wx/defs.h b/include/wx/defs.h
index 63fb8e9331..2b2b5fec49 100644
--- a/include/wx/defs.h
+++ b/include/wx/defs.h
@@ -517,10 +517,13 @@ typedef int wxWindowID;
 /*  Macro to issue warning when using deprecated functions with gcc3 or MSVC7: */
 #if wxCHECK_GCC_VERSION(3, 1)
     #define wxDEPRECATED(x) x __attribute__ ((deprecated))
+    #define wxDEPRECATED_INLINE(func, body) x { body } __attribute__ ((deprecated))
 #elif defined(__VISUALC__) && (__VISUALC__ >= 1300)
     #define wxDEPRECATED(x) __declspec(deprecated) x
+    #define wxDEPRECATED_INLINE(func, body) __declspec(deprecated) x { body }
 #else
     #define wxDEPRECATED(x) x
+    #define wxDEPRECATED_INLINE(func, body) func { body }
 #endif
 
 /*
diff --git a/include/wx/rawbmp.h b/include/wx/rawbmp.h
index 377836fc99..1fdbdcaff7 100644
--- a/include/wx/rawbmp.h
+++ b/include/wx/rawbmp.h
@@ -650,7 +650,7 @@ struct wxPixelDataOut<wxBitmap>
 
 #if WXWIN_COMPATIBILITY_2_8
         // not needed anymore, calls to it should be simply removed
-        wxDEPRECATED( inline void UseAlpha() );
+        wxDEPRECATED_INLINE( void UseAlpha(), wxEMPTY_PARAMETER_VALUE );
 #endif
 
     // private: -- see comment in the beginning of the file
@@ -694,12 +694,6 @@ public:
     }
 };
 
-#if WXWIN_COMPATIBILITY_2_8
-template <class Format>
-inline void wxPixelDataOut<wxBitmap>::wxPixelDataIn<Format>::UseAlpha() {}
-#endif
-
-
 // some "predefined" pixel data classes
 #if wxUSE_IMAGE
 typedef wxPixelData<wxImage> wxImagePixelData;
-- 
2.50.0

