\helpref{wxWakeUpIdle}{wxwakeupidle}\\
\helpref{wxWriteResource}{wxwriteresource}\\
\helpref{wxYield}{wxyield}\\
+\helpref{wx\_const\_cast}{wxconstcastraw}\\
+\helpref{wx\_static\_cast}{wxstaticcastraw}\\
\helpref{\_}{underscore}\\
\helpref{\_T}{underscoret}
\wxheading{See also}
+\helpref{wx\_const\_cast}{wxconstcastraw}\\
\helpref{wxDynamicCast}{wxdynamiccast}\\
\helpref{wxStaticCast}{wxstaticcast}
result if {\tt wxDynamicCast(ptr, classname) == NULL}) and then returns the
result of executing an equivalent of {\tt static\_cast<classname *>(ptr)}.
+\wxheading{See also}
+
+\helpref{wx\_static\_cast}{wxstaticcastraw}\\
\helpref{wxDynamicCast}{wxdynamiccast}\\
\helpref{wxConstCast}{wxconstcast}
+\membersection{wx\_const\_cast}\label{wxconstcastraw}
+
+\func{T}{wx\_const\_cast}{T, x}
+
+Same as \texttt{const\_cast<T>(x)} if the compiler supports const cast or
+\texttt{(T)x} for old compilers. Unlike \helpref{wxConstCast}{wxconstcast},
+the cast it to the type \arg{T} and not to \texttt{T *} and also the order of
+arguments is the same as for the standard cast.
+
+\wxheading{See also}
+
+\helpref{wx\_static\_cast}{wxstaticcastraw}\\
+
+
+\membersection{wx\_static\_cast}\label{wxstaticcastraw}
+
+\func{T}{wx\_static\_cast}{T, x}
+
+Same as \texttt{static\_cast<T>(x)} if the compiler supports static cast or
+\texttt{(T)x} for old compilers. Unlike \helpref{wxStaticCast}{wxstaticcast},
+there are no checks being done and the meaning of the macro arguments is exactly
+the same as for the standard static cast, i.e. \arg{T} is the full type name and
+star is not appended to it.
+
+\wxheading{See also}
+
+\helpref{wx\_const\_cast}{wxconstcastraw}\\
+
+
\section{Log functions}\label{logfunctions}
/**
-* Name: defs.h
-* Purpose: Declarations/definitions common to all wx source files
-* Author: Julian Smart and others
+* Name: defs.h
+* Purpose: Declarations/definitions common to all wx source files
+* Author: Julian Smart and others
* Modified by: Ryan Norton (Converted to C)
-* Created: 01/02/97
-* RCS-ID: $Id$
-* Copyright: (c)
-* Licence: wxWindows licence
+* Created: 01/02/97
+* RCS-ID: $Id$
+* Copyright: (c)
+* Licence: wxWindows licence
*/
/* THIS IS A C FILE, DON'T USE C++ FEATURES (IN PARTICULAR COMMENTS) IN IT */
#include "wx/platform.h"
-/* RN - only double-check the environment when building in C++
+/* RN - only double-check the environment when building in C++
Shouldn't configure pass the environment to all sub-libs too? */
#ifdef __cplusplus
/* Make sure the environment is set correctly */
#endif
#endif /* HAVE_CXX_CASTS */
+#ifdef HAVE_STATIC_CAST
+ #define wx_static_cast(t, x) static_cast<t>(x)
+#else
+ #define wx_static_cast(t, x) ((t)(x))
+#endif
+
#ifdef HAVE_CONST_CAST
- #define wxConstCast(obj, className) const_cast<className *>(obj)
+ #define wx_const_cast(t, x) const_cast<t>(x)
#else
- #define wxConstCast(obj, className) ((className *)(obj))
+ #define wx_const_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)
+
#ifndef HAVE_STD_WSTRING
#if defined(__VISUALC__) && (__VISUALC__ >= 1100)
/* VC++ 6.0 and 5.0 have std::wstring (what about earlier versions?) */
#define wxLongLongSuffix l
#define wxLongLongFmtSpec _T("l")
#define wxLongLongIsLong
-#elif (defined(__VISUALC__) && defined(__WIN32__))
+#elif (defined(__VISUALC__) && defined(__WIN32__))
#define wxLongLong_t __int64
#define wxLongLongSuffix i64
#define wxLongLongFmtSpec _T("I64")
#define wxLongLong_t __int64
#define wxLongLongSuffix i64
#define wxLongLongFmtSpec _T("Ld")
-#elif defined(__DIGITALMARS__)
+#elif defined(__DIGITALMARS__)
#define wxLongLong_t __int64
#define wxLongLongSuffix LL
#define wxLongLongFmtSpec _T("ll")
// this is used to make the event table entry type safe, so that for an event
// handler only a function with proper parameter list can be given.
-#ifdef HAVE_STATIC_CAST
- #define wxStaticCastEvent(type, val) static_cast<type>(val)
-#else
- #define wxStaticCastEvent(type, val) ((type)(val))
-#endif
+#define wxStaticCastEvent(type, val) wx_static_cast(type, val)
// in previous versions of wxWindows the event types used to be constants
// which created difficulties with custom/user event types definition
// get the runtime identity of this object
wxClassInfo *GetClassInfo() const
{
- return const_cast<wxClassInfo*>((const wxClassInfo*)m_classInfo);
+ return wx_const_cast(wxClassInfo *, m_classInfo);
}
wxObject* GetSuperClassInstance() const