]> git.saurik.com Git - wxWidgets.git/blobdiff - include/wx/dynarray.h
Checking for wxUSE_SOCKETS and __GSOCKET_STANDALONE__ should be right, now
[wxWidgets.git] / include / wx / dynarray.h
index e1ee899f16f05c39ad56babbe44872fea9250526..caf4b814d1e2241ee043022b7e205381c11e912a 100644 (file)
  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;                      \