From 8279e59a6162b9140319b15dbba00cbf415d9403 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Thu, 5 Apr 2007 14:58:58 +0000 Subject: [PATCH] define C99-like wxINT8/16/32_MIN/MAX constants in addition to wxInt8/16/32 types git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@45255 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/defs.h | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/include/wx/defs.h b/include/wx/defs.h index bdf2293a34..eff3612016 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -739,7 +739,7 @@ typedef wxUint16 wxWord; |short | 16 16 16 16 16 | |int | 32 64 32 32 16 | |long | 64 64 32 32 32 | - |long long | 64 | + |long long | 64 64 64 -- -- | |void * | 64 64 64 32 32 | +-----------+----------------------------+ @@ -862,6 +862,23 @@ typedef wxUint16 wxWord; #endif #endif /* Win/!Win */ +/* also define C99-like sized MIN/MAX constants */ +#define wxINT8_MIN CHAR_MIN +#define wxINT8_MAX CHAR_MAX + +#define wxINT16_MIN SHRT_MIN +#define wxINT16_MAX SHRT_MAX + +#if SIZEOF_INT == 4 + #define wxINT32_MIN INT_MIN + #define wxINT32_MAX INT_MAX +#elif SIZEOF_LONG == 4 + #define wxINT32_MIN LONG_MIN + #define wxINT32_MAX LONG_MAX +#else + #error "Unknown 32 bit type" +#endif + typedef wxUint32 wxDword; /* -- 2.47.2