From 1894e49f5178a94e557cdc7d987271369bb28fdf Mon Sep 17 00:00:00 2001
From: Vadim Zeitlin <vadim@wxwidgets.org>
Date: Sun, 27 Jan 2008 14:10:53 +0000
Subject: [PATCH] add wxCONCAT[345]() helper macros

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@51407 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
---
 docs/latex/wx/function.tex | 12 ++++++++++--
 include/wx/cpp.h           |  4 ++++
 2 files changed, 14 insertions(+), 2 deletions(-)

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)
-- 
2.50.0

