X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/664e13143ee51a6b1aa1c30d1401ac04b11bdcca..66c2bf7b1d9326fb650acfaae22ec50528cfbf7c:/include/wx/checkeddelete.h?ds=inline diff --git a/include/wx/checkeddelete.h b/include/wx/checkeddelete.h index a9e14c3a2e..fd295faf8b 100644 --- a/include/wx/checkeddelete.h +++ b/include/wx/checkeddelete.h @@ -3,7 +3,6 @@ // Purpose: wxCHECKED_DELETE() macro // Author: Vadim Zeitlin // Created: 2009-02-03 -// RCS-ID: $Id$ // Copyright: (c) 2002-2009 wxWidgets dev team // Licence: wxWindows licence /////////////////////////////////////////////////////////////////////////////// @@ -11,6 +10,8 @@ #ifndef _WX_CHECKEDDELETE_H_ #define _WX_CHECKEDDELETE_H_ +#include "wx/cpp.h" + // TODO: provide wxCheckedDelete[Array]() template functions too // ---------------------------------------------------------------------------- @@ -26,28 +27,17 @@ still force a semicolon after the macro */ -#ifdef __WATCOMC__ - #define wxFOR_ONCE(name) for(int name=0; name<1; name++) - #define wxPRE_NO_WARNING_SCOPE(name) wxFOR_ONCE(wxMAKE_UNIQUE_NAME(name)) - #define wxPOST_NO_WARNING_SCOPE(name) -#else - #define wxPRE_NO_WARNING_SCOPE(name) do - #define wxPOST_NO_WARNING_SCOPE(name) while ( wxFalse ) -#endif - #define wxCHECKED_DELETE(ptr) \ - wxPRE_NO_WARNING_SCOPE(scope_var1) \ - { \ - typedef char complete[sizeof(*ptr)]; \ + wxSTATEMENT_MACRO_BEGIN \ + typedef char complete[sizeof(*ptr)] WX_ATTRIBUTE_UNUSED; \ delete ptr; \ - } wxPOST_NO_WARNING_SCOPE(scope_var1) + wxSTATEMENT_MACRO_END #define wxCHECKED_DELETE_ARRAY(ptr) \ - wxPRE_NO_WARNING_SCOPE(scope_var2) \ - { \ - typedef char complete[sizeof(*ptr)]; \ + wxSTATEMENT_MACRO_BEGIN \ + typedef char complete[sizeof(*ptr)] WX_ATTRIBUTE_UNUSED; \ delete [] ptr; \ - } wxPOST_NO_WARNING_SCOPE(scope_var2) + wxSTATEMENT_MACRO_END #endif // _WX_CHECKEDDELETE_H_