X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1777b9bbf4573dabecf4a3256d0d3c2c0c2a3fdf..83413d6d2d4146c7c3ff46be54235d821d212328:/include/wx/dynarray.h?ds=sidebyside diff --git a/include/wx/dynarray.h b/include/wx/dynarray.h index b05f260955..caf4b814d1 100644 --- a/include/wx/dynarray.h +++ b/include/wx/dynarray.h @@ -174,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; \ @@ -232,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; \