]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/dynarray.h
*** empty log message ***
[wxWidgets.git] / include / wx / dynarray.h
index b05f260955c26951005da67ec6e2de47e0987a41..caf4b814d1e2241ee043022b7e205381c11e912a 100644 (file)
@@ -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;                      \