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
// ----------------------------------------------------------------------------
#define _WX_DEFINE_ARRAY(T, name) \
typedef int (CMPFUNC_CONV *CMPFUNC##T)(T *pItem1, T *pItem2); \
-class WXDLLEXPORTLOCAL name : public wxBaseArray \
+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; \
// ----------------------------------------------------------------------------
#define _WX_DEFINE_SORTED_ARRAY(T, name) \
typedef int (CMPFUNC_CONV *SCMPFUNC##T)(T pItem1, T pItem2); \
-class WXDLLEXPORTLOCAL name : public wxBaseArray \
+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; \
// ----------------------------------------------------------------------------
#define _WX_DECLARE_OBJARRAY(T, name) \
typedef int (CMPFUNC_CONV *CMPFUNC##T)(T** pItem1, T** pItem2); \
-class WXDLLEXPORTLOCAL name : public wxBaseArray \
+class WXDLLEXPORT name : public wxBaseArray \
{ \
public: \
name() { } \
// # overhead if not used?
// ----------------------------------------------------------------------------
-#define WXDLLEXPORTLOCAL WXDLLEXPORT
-
//@{
/** @name ArrayInt */
WX_DEFINE_ARRAY(int, wxArrayInt);
//@}
-#undef WXDLLEXPORTLOCAL
-#define WXDLLEXPORTLOCAL
-
// -----------------------------------------------------------------------------
// convinience macros
// -----------------------------------------------------------------------------