removed pragma interface which resulted in link errors when inline functions from this file were used; remove wxULongToPtr/wxPtrToULong which could truncate the pointer; added wxUIntToPtr in addition to existing wxPtrToUInt (which now takes const pointer) to replace them

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29895 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin 2004-10-15 20:58:23 +00:00
parent f12885449a
commit dffd27ec31

View File

@ -14,10 +14,6 @@
#ifndef _WX_DEFS_H_
#define _WX_DEFS_H_
#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA)
#pragma interface "defs.h"
#endif
/* ---------------------------------------------------------------------------- */
/* compiler and OS identification */
/* ---------------------------------------------------------------------------- */
@ -779,8 +775,8 @@ typedef wxUint32 wxDword;
#endif
#ifdef __cplusplus
/* And also define a simple function to cast pointer to it. */
inline wxUIntPtr wxPtrToUInt(void *p)
/* And also define a couple of simple functions to cast pointer to/from it. */
inline wxUIntPtr wxPtrToUInt(const void *p)
{
/*
VC++ 7.1 gives warnings about casts such as below even when they're
@ -797,6 +793,11 @@ inline wxUIntPtr wxPtrToUInt(void *p)
#pragma warning(default: 4311)
#endif
}
inline void *wxUIntToPtr(wxUIntPtr p)
{
return wx_reinterpret_cast(void *, p);
}
#endif /*__cplusplus*/
@ -1048,12 +1049,6 @@ typedef float wxFloat32;
#define wxUINT64_SWAP_ON_BE(val) (val)
#endif
/* Macros to convert from unsigned long to void pointer. */
/* High order truncation occurs if the respective type is not large enough. */
#define WXPTRULONGSLICE (((wxBYTE_ORDER==wxBIG_ENDIAN)&&(sizeof(void*)==8)&&(sizeof(unsigned long)<8))?1:0)
#define wxPtrToULong(p) (((unsigned long*)(&(p)))[WXPTRULONGSLICE])
#define wxULongToPtr(p,n) (p=NULL,wxPtrToULong(p)=(unsigned long)(n),p)
/* ---------------------------------------------------------------------------- */
/* Geometric flags */
/* ---------------------------------------------------------------------------- */