From 8c8d66c5f06ed3b4f7b2d14966bf84333f60606f Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Tue, 28 Sep 2004 21:44:10 +0000
Subject: [PATCH] added wx_reinterpret_cast() macro

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

diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex
index 1f43b2ddad..d1874e25c3 100644
--- a/docs/latex/wx/function.tex
+++ b/docs/latex/wx/function.tex
@@ -242,6 +242,7 @@ the corresponding topic.
 \helpref{wxWriteResource}{wxwriteresource}\\
 \helpref{wxYield}{wxyield}\\
 \helpref{wx\_const\_cast}{wxconstcastraw}\\
+\helpref{wx\_reinterpret\_cast}{wxreinterpretcastraw}\\
 \helpref{wx\_static\_cast}{wxstaticcastraw}\\
 \helpref{\_}{underscore}\\
 \helpref{\_T}{underscoret}
@@ -3425,7 +3426,21 @@ arguments is the same as for the standard cast.
 
 \wxheading{See also}
 
-\helpref{wx\_static\_cast}{wxstaticcastraw}\\
+\helpref{wx\_reinterpret\_cast}{wxreinterpretcastraw},\\
+\helpref{wx\_static\_cast}{wxstaticcastraw}
+
+
+\membersection{wx\_reinterpret\_cast}\label{wxreinterpretcastraw}
+
+\func{T}{wx\_reinterpret\_cast}{T, x}
+
+Same as \texttt{reinterpret\_cast<T>(x)} if the compiler supports reinterpret cast or 
+\texttt{(T)x} for old compilers.
+
+\wxheading{See also}
+
+\helpref{wx\_const\_cast}{wxconstcastraw},\\
+\helpref{wx\_static\_cast}{wxstaticcastraw}
 
 
 \membersection{wx\_static\_cast}\label{wxstaticcastraw}
@@ -3440,7 +3455,8 @@ star is not appended to it.
 
 \wxheading{See also}
 
-\helpref{wx\_const\_cast}{wxconstcastraw}\\
+\helpref{wx\_const\_cast}{wxconstcastraw},\\
+\helpref{wx\_reinterpret\_cast}{wxreinterpretcastraw}
 
 
 
diff --git a/include/wx/defs.h b/include/wx/defs.h
index 460ec94c0b..56edd14839 100644
--- a/include/wx/defs.h
+++ b/include/wx/defs.h
@@ -270,6 +270,9 @@ typedef int wxWindowID;
     #ifndef HAVE_CONST_CAST
         #define HAVE_CONST_CAST
     #endif
+    #ifndef HAVE_REINTERPRET_CAST
+        #define HAVE_REINTERPRET_CAST
+    #endif
     #ifndef HAVE_STATIC_CAST
         #define HAVE_STATIC_CAST
     #endif
@@ -287,6 +290,12 @@ typedef int wxWindowID;
     #define wx_const_cast(t, x) ((t)(x))
 #endif
 
+#ifdef HAVE_REINTERPRET_CAST
+    #define wx_reinterpret_cast(t, x) reinterpret_cast<t>(x)
+#else
+    #define wx_reinterpret_cast(t, x) ((t)(x))
+#endif
+
 /* for consistency with wxStatic/DynamicCast defined in wx/object.h */
 #define wxConstCast(obj, className) wx_const_cast(className *, obj)
 
-- 
2.50.0

