X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/683730003ba8f36fa07496b8f298d40733534aea..0ce742cf092c9244f27957e308c16f3c2631042d:/include/wx/dynarray.h diff --git a/include/wx/dynarray.h b/include/wx/dynarray.h index e1ee899f16..caf4b814d1 100644 --- a/include/wx/dynarray.h +++ b/include/wx/dynarray.h @@ -44,8 +44,10 @@ must return negative value, 0 or positive value if pItem1 <, = or > pItem2 */ -#ifdef __VISUALC__ +#if defined(__VISUALC__) #define CMPFUNC_CONV _cdecl +#elif defined(__VISAGECPP__) + #define CMPFUNC_CONV _Optlink #else // !Visual C++ #define CMPFUNC_CONV #endif // compiler @@ -172,7 +174,12 @@ class WXDLLEXPORT name : public wxBaseArray \ { \ public: \ name() \ - { wxASSERT( sizeof(T) <= sizeof(long) ); } \ + { \ + size_t type = sizeof(T); \ + size_t sizelong = sizeof(long); \ + if ( type > sizelong ) \ + { wxFAIL_MSG( _T("illegal use of DEFINE_ARRAY") ); } \ + } \ \ name& operator=(const name& src) \ { wxBaseArray* temp = (wxBaseArray*) this; \ @@ -230,7 +237,12 @@ class WXDLLEXPORT name : public wxBaseArray \ { \ public: \ name(SCMPFUNC##T fn) \ - { wxASSERT( sizeof(T) <= sizeof(long) ); m_fnCompare = fn; } \ + { size_t type = sizeof(T); \ + size_t sizelong = sizeof(long); \ + if ( type > sizelong ) \ + { wxFAIL_MSG( _T("illegal use of DEFINE_ARRAY") ); } \ + m_fnCompare = fn; \ + } \ \ name& operator=(const name& src) \ { wxBaseArray* temp = (wxBaseArray*) this; \