From: Vadim Zeitlin Date: Sun, 27 Jan 2008 14:10:53 +0000 (+0000) Subject: add wxCONCAT[345]() helper macros X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/1894e49f5178a94e557cdc7d987271369bb28fdf add wxCONCAT[345]() helper macros git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51407 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/docs/latex/wx/function.tex b/docs/latex/wx/function.tex index b6de53e475..89dd6dba9b 100644 --- a/docs/latex/wx/function.tex +++ b/docs/latex/wx/function.tex @@ -3006,9 +3006,17 @@ to \helpref{wxBase64Encode}{wxbase64encode}. \membersection{wxCONCAT}\label{wxconcat} -\func{}{wxCONCAT}{\param{}{x}, \param{}{y}} +\func{}{wxCONCAT}{\param{}{x1}, \param{}{x2}} -This macro returns the concatenation of two tokens \arg{x} and \arg{y}. +\func{}{wxCONCAT3}{\param{}{x1}, \param{}{x2}, \param{}{x3}} + +\func{}{wxCONCAT4}{\param{}{x1}, \param{}{x2}, \param{}{x3}, \param{}{x4}} + +\func{}{wxCONCAT5}{\param{}{x1}, \param{}{x2}, \param{}{x3}, \param{}{x4}, \param{}{x5}} + +These macro return the concatenation of the tokens passed as their arguments. +Unlike when using the preprocessor \texttt{##} operator, the arguments undergo +the macro expansion before being concatenated. \membersection{wxDECLARE\_APP}\label{wxdeclareapp} diff --git a/include/wx/cpp.h b/include/wx/cpp.h index 7e9a436049..82931e6dd7 100644 --- a/include/wx/cpp.h +++ b/include/wx/cpp.h @@ -17,6 +17,10 @@ #define wxCONCAT_HELPER(text, line) text ## line #define wxCONCAT(text, line) wxCONCAT_HELPER(text, line) +#define wxCONCAT3(x1, x2, x3) wxCONCAT(wxCONCAT(x1, x2), x3) +#define wxCONCAT4(x1, x2, x3, x4) wxCONCAT(wxCONCAT3(x1, x2, x3), x4) +#define wxCONCAT5(x1, x2, x3, x4, x5) wxCONCAT(wxCONCAT4(x1, x2, x3, x4), x5) + /* wxSTRINGIZE works as the preprocessor # operator but also works with macros */ #define wxSTRINGIZE_HELPER(x) #x #define wxSTRINGIZE(x) wxSTRINGIZE_HELPER(x)