safer definitions for wx(U)Int32,16 (taken from intl.cpp)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@14618 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -468,17 +468,43 @@ enum
|
|||||||
#define wxInt8 char signed
|
#define wxInt8 char signed
|
||||||
#define wxUint8 char unsigned
|
#define wxUint8 char unsigned
|
||||||
|
|
||||||
#if defined(__WIN16__) || (defined(SIZEOF_INT) && (SIZEOF_INT == 2))
|
#ifdef __WINDOWS__
|
||||||
#define wxInt16 int signed
|
#if defined(__WIN16__)
|
||||||
#define wxUint16 int unsigned
|
#define wxInt16 int signed
|
||||||
#define wxInt32 long signed
|
#define wxUint16 int unsigned
|
||||||
#define wxUint32 long unsigned
|
#define wxInt32 long signed
|
||||||
#else
|
#define wxUint32 long unsigned
|
||||||
#define wxInt16 short signed
|
#elif defined(__WIN32__)
|
||||||
#define wxUint16 short unsigned
|
#define wxInt16 short signed
|
||||||
#define wxInt32 int signed
|
#define wxUint16 short unsigned
|
||||||
#define wxUint32 int unsigned
|
#define wxInt32 int signed
|
||||||
#endif
|
#define wxUint32 int unsigned
|
||||||
|
#else
|
||||||
|
// Win64 will have different type sizes
|
||||||
|
#error "Please define a 32 bit type"
|
||||||
|
#endif
|
||||||
|
#else // !Windows
|
||||||
|
// SIZEOF_XXX are defined by configure
|
||||||
|
#if defined(SIZEOF_INT) && (SIZEOF_INT == 4)
|
||||||
|
#define wxInt16 short signed
|
||||||
|
#define wxUint16 short unsigned
|
||||||
|
#define wxInt32 int signed
|
||||||
|
#define wxUint32 int unsigned
|
||||||
|
#elif defined(SIZEOF_INT) && (SIZEOF_INT == 2)
|
||||||
|
#define wxInt16 int signed
|
||||||
|
#define wxUint16 int unsigned
|
||||||
|
#define wxInt32 long signed
|
||||||
|
#define wxUint32 long unsigned
|
||||||
|
#else
|
||||||
|
// assume sizeof(int) == 4 - what else can we do
|
||||||
|
wxCOMPILE_TIME_ASSERT( sizeof(int) == 4, IntMustBeExactly4Bytes);
|
||||||
|
|
||||||
|
#define wxInt16 short signed
|
||||||
|
#define wxUint16 short unsigned
|
||||||
|
#define wxInt32 int signed
|
||||||
|
#define wxUint32 int unsigned
|
||||||
|
#endif
|
||||||
|
#endif // Win/!Win
|
||||||
|
|
||||||
#if defined(SIZEOF_LONG) && (SIZEOF_LONG == 8)
|
#if defined(SIZEOF_LONG) && (SIZEOF_LONG == 8)
|
||||||
#define wxInt64 long signed
|
#define wxInt64 long signed
|
||||||
|
Reference in New Issue
Block a user