X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/9d2f3c71d83c52fc4db6c8041de533562816b1d6..799a341cc390e42c04b5705e316a406ee9bc713d:/include/wx/dynarray.h diff --git a/include/wx/dynarray.h b/include/wx/dynarray.h index 4d87b0bed1..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 @@ -168,11 +170,16 @@ private: // ---------------------------------------------------------------------------- #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; \ @@ -226,11 +233,16 @@ public: \ // ---------------------------------------------------------------------------- #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; \ @@ -267,7 +279,7 @@ private: \ // ---------------------------------------------------------------------------- #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() { } \ @@ -403,8 +415,6 @@ private: \ // # overhead if not used? // ---------------------------------------------------------------------------- -#define WXDLLEXPORTLOCAL WXDLLEXPORT - //@{ /** @name ArrayInt */ WX_DEFINE_ARRAY(int, wxArrayInt); @@ -416,9 +426,6 @@ WX_DEFINE_ARRAY(void *, wxArrayPtrVoid); //@} -#undef WXDLLEXPORTLOCAL -#define WXDLLEXPORTLOCAL - // ----------------------------------------------------------------------------- // convinience macros // -----------------------------------------------------------------------------