X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/90c0f63a835e4ac6bf73d8671edcf85ff063731f..4a4bf7eefbc04cb91652031d9a729720d52dde61:/include/wx/defs.h diff --git a/include/wx/defs.h b/include/wx/defs.h index bdc630b91d..e22a7d625e 100644 --- a/include/wx/defs.h +++ b/include/wx/defs.h @@ -375,7 +375,7 @@ typedef int wxWindowID; /* VC++ 6.0 and 5.0 have std::wstring (what about earlier versions?) */ #define HAVE_STD_WSTRING #elif ( defined(__MINGW32__) || defined(__CYGWIN32__) ) \ - && wxCHECK_GCC_VERSION(3, 1) + && wxCHECK_GCC_VERSION(3, 3) /* GCC 3.1 has std::wstring; 3.0 never was in MinGW, 2.95 hasn't it */ #define HAVE_STD_WSTRING #endif @@ -658,6 +658,18 @@ typedef int wxCoord; enum { wxDefaultCoord = -1 }; +/* round-to-nearest (used in scaling) */ +#ifdef __cplusplus +inline wxCoord wxCoordRound(const float& f) +{ + return (f > 0) ? (wxCoord)(f + 0.5) : (f < 0) ? (wxCoord)(f - 0.5) : 0; +} +inline wxCoord wxCoordRound(const double& f) +{ + return (f > 0) ? (wxCoord)(f + 0.5) : (f < 0) ? (wxCoord)(f - 0.5) : 0; +} +#endif + /* ---------------------------------------------------------------------------- */ /* define fixed length types */ /* ---------------------------------------------------------------------------- */ @@ -969,7 +981,7 @@ inline void *wxUIntToPtr(wxUIntPtr p) #define wxULongLong_t unsigned wxLongLong_t #endif - /* these macros allow to definea 64 bit constants in a portable way */ + /* these macros allow to define 64 bit constants in a portable way */ #define wxLL(x) wxCONCAT(x, wxLongLongSuffix) #define wxULL(x) wxCONCAT(x, wxCONCAT(u, wxLongLongSuffix)) @@ -979,7 +991,7 @@ inline void *wxUIntToPtr(wxUIntPtr p) #define wxHAS_INT64 1 #elif wxUSE_LONGLONG - /* these macros allow to definea 64 bit constants in a portable way */ + /* these macros allow to define 64 bit constants in a portable way */ #define wxLL(x) wxLongLong(x) #define wxULL(x) wxULongLong(x)