Squash warnings from wx

See: http://trac.wxwidgets.org/ticket/15137
This commit is contained in:
Jasper St. Pierre 2013-07-05 22:12:52 -04:00
parent d584150851
commit 7493f19cda
2 changed files with 12 additions and 4 deletions

View File

@ -38,14 +38,14 @@
#define wxCHECKED_DELETE(ptr) \
wxPRE_NO_WARNING_SCOPE(scope_var1) \
{ \
typedef char complete[sizeof(*ptr)]; \
typedef char complete[sizeof(*ptr)] WX_ATTRIBUTE_UNUSED; \
delete ptr; \
} wxPOST_NO_WARNING_SCOPE(scope_var1)
#define wxCHECKED_DELETE_ARRAY(ptr) \
wxPRE_NO_WARNING_SCOPE(scope_var2) \
{ \
typedef char complete[sizeof(*ptr)]; \
typedef char complete[sizeof(*ptr)] WX_ATTRIBUTE_UNUSED; \
delete [] ptr; \
} wxPOST_NO_WARNING_SCOPE(scope_var2)

View File

@ -577,6 +577,14 @@ typedef short int WXTYPE;
#include <stddef.h>
#endif
#if defined(__GNUC__)
#define WX_ATTRIBUTE_UNUSED __attribute__ ((unused))
#else
#define WX_ATTRIBUTE_UNUSED
#endif
#ifdef __cplusplus
// everybody gets the assert and other debug macros
@ -586,7 +594,7 @@ typedef short int WXTYPE;
template <typename T>
inline void wxDELETE(T*& ptr)
{
typedef char TypeIsCompleteCheck[sizeof(T)];
typedef char TypeIsCompleteCheck[sizeof(T)] WX_ATTRIBUTE_UNUSED;
if ( ptr != NULL )
{
@ -599,7 +607,7 @@ typedef short int WXTYPE;
template <typename T>
inline void wxDELETEA(T*& ptr)
{
typedef char TypeIsCompleteCheck[sizeof(T)];
typedef char TypeIsCompleteCheck[sizeof(T)] WX_ATTRIBUTE_UNUSED;
if ( ptr != NULL )
{