Update of /cvsroot/cppunit/cppunit2/include/cpptl
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12359/include/cpptl
Modified Files:
config.h reflection.h
Log Message:
* renamed and moved macro CPPUT_MAKE_UNIQUE_NAME to cpptl library.
Index: config.h
===================================================================
RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/config.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** config.h 28 Feb 2005 21:36:19 -0000 1.9
--- config.h 3 Mar 2005 20:57:13 -0000 1.10
***************
*** 105,108 ****
--- 105,147 ----
# define CPPTL_API
+
+
+
+ // Macro tools...
+ ///////////////////////////////////////////////////////////////////////////
+
+
+ /*! Joins to symbol after expanding them into string.
+ *
+ * Use this macro to join two symbols. Example of usage:
+ *
+ * \code
+ * #define MAKE_UNIQUE_NAME(prefix) CPPTL_JOIN( prefix, __LINE__ )
+ * \endcode
+ *
+ * The macro defined in the example concatenate a given prefix with the line number
+ * to obtain a 'unique' identifier.
+ *
+ * \internal From boost documentation:
+ * The following piece of macro magic joins the two
+ * arguments together, even when one of the arguments is
+ * itself a macro (see 16.3.1 in C++ standard). The key
+ * is that macro expansion of macro arguments does not
+ * occur in CPPUT_JOIN2 but does in CPPTL_JOIN.
+ */
+ #define CPPTL_JOIN( symbol1, symbol2 ) _CPPTL_DO_JOIN( symbol1, symbol2 )
+
+ /// \internal
+ #define _CPPTL_DO_JOIN( symbol1, symbol2 ) _CPPTL_DO_JOIN2( symbol1, symbol2 )
+
+ /// \internal
+ #define _CPPTL_DO_JOIN2( symbol1, symbol2 ) symbol1##symbol2
+
+ /*! Adds the line number to the specified string to create a unique identifier.
+ * \param prefix Prefix added to the line number to create a unique identifier.
+ * \see CPPUT_TEST_SUITE_REGISTRATION for an example of usage.
+ */
+ #define CPPTL_MAKE_UNIQUE_NAME( prefix ) CPPTL_JOIN( prefix, __LINE__ )
+
///////////////////////////////////////////////////////////////////////////
Index: reflection.h
===================================================================
RCS file: /cvsroot/cppunit/cppunit2/include/cpptl/reflection.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** reflection.h 3 Mar 2005 20:48:54 -0000 1.2
--- reflection.h 3 Mar 2005 20:57:14 -0000 1.3
***************
*** 354,358 ****
# define CPPTL_REFLECT_REGISTER_CLASS( ClassType ) \
static ::CppTL::AutoRegisterClassReflection<ClassType> \
! CPPUT_MAKE_UNIQUE_NAME(cpptlReflectRegisterClass);
--- 354,358 ----
# define CPPTL_REFLECT_REGISTER_CLASS( ClassType ) \
static ::CppTL::AutoRegisterClassReflection<ClassType> \
! CPPTL_MAKE_UNIQUE_NAME(cpptlReflectRegisterClass);
|