From bde626ce30c80dd9409b7214f43e92c0f62447a0 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 3 Nov 2006 21:06:57 +0000 Subject: [PATCH] don't define EMPTY_PARAMETER_VALUE macro without wx prefix, this is an invitation for name clash; instead define wxEMPTY_PARAMETER_VALUE and use it in both variant.h and event.h git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42993 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- include/wx/cpp.h | 6 ++++++ include/wx/event.h | 5 ++--- include/wx/variant.h | 11 +++-------- 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/wx/cpp.h b/include/wx/cpp.h index 6c93ca0ac9..77a907f3ac 100644 --- a/include/wx/cpp.h +++ b/include/wx/cpp.h @@ -47,5 +47,11 @@ /* Create a "unique" name with the given prefix */ #define wxMAKE_UNIQUE_NAME(text) wxCONCAT_LINE(text) +/* + This macro can be passed as argument to another macro when you don't have + anything to pass in fact. + */ +#define wxEMPTY_PARAMETER_VALUE /* Fake macro parameter value */ + #endif // _WX_CPP_H_ diff --git a/include/wx/event.h b/include/wx/event.h index e04df54707..7c55d2c551 100644 --- a/include/wx/event.h +++ b/include/wx/event.h @@ -13,6 +13,7 @@ #define _WX_EVENT_H__ #include "wx/defs.h" +#include "wx/cpp.h" #include "wx/object.h" #include "wx/clntdata.h" @@ -94,8 +95,6 @@ typedef int wxEventType; #define DECLARE_EVENT_TABLE_ENTRY(type, winid, idLast, fn, obj) \ wxEventTableEntry(type, winid, idLast, fn, obj) -#define EMPTY_PARAMETER_VALUE /* Fake macro parameter value */ - #define BEGIN_DECLARE_EVENT_TYPES() #define END_DECLARE_EVENT_TYPES() #define DECLARE_EXPORTED_EVENT_TYPE(expdecl, name, value) \ @@ -103,7 +102,7 @@ typedef int wxEventType; #define DECLARE_EVENT_TYPE(name, value) \ DECLARE_EXPORTED_EVENT_TYPE(WXDLLIMPEXP_CORE, name, value) #define DECLARE_LOCAL_EVENT_TYPE(name, value) \ - DECLARE_EXPORTED_EVENT_TYPE(EMPTY_PARAMETER_VALUE, name, value) + DECLARE_EXPORTED_EVENT_TYPE(wxEMPTY_PARAMETER_VALUE, name, value) #define DEFINE_EVENT_TYPE(name) const wxEventType name = wxNewEventType(); #define DEFINE_LOCAL_EVENT_TYPE(name) DEFINE_EVENT_TYPE(name) diff --git a/include/wx/variant.h b/include/wx/variant.h index 5d971dbba7..6087c029dd 100644 --- a/include/wx/variant.h +++ b/include/wx/variant.h @@ -20,6 +20,7 @@ #include "wx/string.h" #include "wx/arrstr.h" #include "wx/list.h" +#include "wx/cpp.h" #if wxUSE_DATETIME #include "wx/datetime.h" @@ -316,21 +317,15 @@ private: DECLARE_DYNAMIC_CLASS(wxVariant) }; -/* Fake macro parameter value */ -#ifdef EMPTY_PARAMETER_VALUE - #undef EMPTY_PARAMETER_VALUE -#endif -#define EMPTY_PARAMETER_VALUE - #define DECLARE_VARIANT_OBJECT(classname) \ - DECLARE_VARIANT_OBJECT_EXPORTED(classname,EMPTY_PARAMETER_VALUE) + DECLARE_VARIANT_OBJECT_EXPORTED(classname, wxEMPTY_PARAMETER_VALUE) #define DECLARE_VARIANT_OBJECT_EXPORTED(classname,expdecl) \ expdecl classname& operator << ( classname &object, const wxVariant &variant ); \ expdecl wxVariant& operator << ( wxVariant &variant, const classname &object ); #define IMPLEMENT_VARIANT_OBJECT(classname) \ - IMPLEMENT_VARIANT_OBJECT_EXPORTED(classname,EMPTY_PARAMETER_VALUE) + IMPLEMENT_VARIANT_OBJECT_EXPORTED(classname, wxEMPTY_PARAMETER_VALUE) #define IMPLEMENT_VARIANT_OBJECT_EXPORTED_NO_EQ(classname,expdecl) \ class classname##VariantData: public wxVariantData \ -- 2.45.2