From: Jouk Jansen Date: Tue, 30 Mar 2010 11:54:37 +0000 (+0000) Subject: Defining wxCOMPILE_TIME_ASSERT for OpenVMS X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/7126436ab4846972e03db5077ba31ac169256cb3?ds=inline Defining wxCOMPILE_TIME_ASSERT for OpenVMS git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@63803 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/include/wx/debug.h b/include/wx/debug.h index 46c676359b..125c2275ed 100644 --- a/include/wx/debug.h +++ b/include/wx/debug.h @@ -380,6 +380,24 @@ extern void WXDLLIMPEXP_BASE wxOnAssert(const char *file, unsigned int msg: expr; \ wxMAKE_UNIQUE_ASSERT_NAME() { wxUnusedVar(msg); } \ } +#elif defined( __VMS ) +namespace wxdebug{ + +// HP aCC cannot deal with missing names for template value parameters +template struct STATIC_ASSERTION_FAILURE; + +template <> struct STATIC_ASSERTION_FAILURE { enum { value = 1 }; }; + +// HP aCC cannot deal with missing names for template value parameters +template struct static_assert_test{}; + +} + #define WX_JOIN( X, Y ) X##Y + #define WX_STATIC_ASSERT_BOOL_CAST(x) (bool)(x) + #define wxCOMPILE_TIME_ASSERT(expr, msg) \ + typedef ::wxdebug::static_assert_test<\ + sizeof(::wxdebug::STATIC_ASSERTION_FAILURE< WX_STATIC_ASSERT_BOOL_CAST( expr ) >)>\ + WX_JOIN(boost_static_assert_typedef_, __LINE__) #else #define wxCOMPILE_TIME_ASSERT(expr, msg) \ struct wxMAKE_UNIQUE_ASSERT_NAME { unsigned int msg: expr; } diff --git a/samples/dialogs/dialogs.cpp b/samples/dialogs/dialogs.cpp index a09b14714c..1d1689bf57 100644 --- a/samples/dialogs/dialogs.cpp +++ b/samples/dialogs/dialogs.cpp @@ -2599,12 +2599,7 @@ TestMessageBoxDialog::TestMessageBoxDialog(wxWindow *parent) "&Error icon" }; -#ifndef __VMS - // This contruction not is not valid on OpenVMS: - // %CXX-W-REFNESTFUNVAR, reference to local variable of enclosing function is - // not allowed wxCOMPILE_TIME_ASSERT( WXSIZEOF(icons) == MsgDlgIcon_Max, IconMismatch ); -#endif m_icons = new wxRadioBox(this, wxID_ANY, "&Icon style", wxDefaultPosition, wxDefaultSize,