X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c0fbf9294e94c1539aaee8989e28d54250b730ea..36b79d445d08e08776e721d71a832f38daa7fa8c:/include/wx/defs.h diff --git a/include/wx/defs.h b/include/wx/defs.h index 4e4ca874d1..91595ae2c8 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -62,7 +62,7 @@ /* suppress some Visual C++ warnings */ #ifdef __VISUALC__ - /* the only "real" warning here is 4244 but there arej ust too many of them */ + /* the only "real" warning here is 4244 but there are just too many of them */ /* in our code... one day someone should go and fix them but until then... */ # pragma warning(disable:4201) /* nonstandard extension used: nameless struct/union */ # pragma warning(disable:4244) /* conversion from double to float */ @@ -473,11 +473,11 @@ typedef int wxWindowID; /* appending the current line number to the given identifier to reduce the */ /* probability of the conflict (it may still happen if this is used in the */ /* headers, hence you should avoid doing it or provide unique prefixes then) */ -#ifdef __VISUALC__ +#if defined(__VISUALC__) && (__VISUALC__ >= 1300) /* __LINE__ handling is completely broken in VC++ when using "Edit and Continue" (/ZI option) and results in preprocessor errors if we use it - inside the macros. Luckily it has another standard macro which can be + inside the macros. Luckily VC7 has another standard macro which can be used like this and is even better than __LINE__ because it is globally unique. */ @@ -685,7 +685,8 @@ typedef wxUint16 wxWord; typedef int wxInt32; typedef unsigned int wxUint32; - /* conside that if SIZEOF_INT is defined, all the other ones are too */ + /* Assume that if SIZEOF_INT is defined that all the other ones except + SIZEOF_SIZE_T, are too. See next #if below. */ #ifndef SIZEOF_INT #define SIZEOF_INT 4 #define SIZEOF_LONG 4 @@ -712,6 +713,19 @@ typedef wxUint16 wxWord; #define SIZEOF_VOID_P 4 #endif /* Win64/32 */ #endif /* !defined(SIZEOF_INT) */ + + /* + If Python.h was included first, it defines all of the SIZEOF's above + except for SIZEOF_SIZE_T, so we need to do it here to avoid + triggering the #error in the ssize_t typedefs below... + */ + #ifndef SIZEOF_SIZE_T + #ifdef __WIN64__ + #define SIZEOF_SIZE_T 8 + #else /* Win32 */ + #define SIZEOF_SIZE_T 4 + #endif + #endif #else #error "Unsupported Windows version" #endif @@ -886,6 +900,25 @@ inline void *wxUIntToPtr(wxUIntPtr p) #endif +/* Make sure ssize_t is defined (a signed type the same size as size_t) */ +/* HAVE_SSIZE_T should be defined for compiliers that already have it */ +#ifdef __MINGW32__ + #include + #if defined(_SSIZE_T_) && !defined(HAVE_SSIZE_T) + #define HAVE_SSIZE_T + #endif +#endif +#ifndef HAVE_SSIZE_T + #if SIZEOF_SIZE_T == 4 + typedef wxInt32 ssize_t; + #elif SIZEOF_SIZE_T == 8 + typedef wxInt64 ssize_t + #else + #error "error defining ssize_t, size_t is not 4 or 8 bytes" + #endif +#endif + + /* base floating point types */ /* wxFloat32: 32 bit IEEE float ( 1 sign, 8 exponent bits, 23 fraction bits */ /* wxFloat64: 64 bit IEEE float ( 1 sign, 11 exponent bits, 52 fraction bits */ @@ -1874,7 +1907,10 @@ enum wxKeyCode WXK_SPACE = 32, WXK_DELETE = 127, - WXK_START = 300, + /* These are, by design, not compatable with unicode characters. + If you want to get a unicode character from a key event, use + wxKeyEvent::GetUnicodeKey instead. */ + WXK_START = 300, WXK_LBUTTON, WXK_RBUTTON, WXK_CANCEL,