summaryrefslogtreecommitdiff
path: root/include/cppunit/Portability.h
diff options
context:
space:
mode:
authorBaptiste Lepilleur <gaiacrtn@free.fr>2002-07-12 04:59:58 +0000
committerBaptiste Lepilleur <gaiacrtn@free.fr>2002-07-12 04:59:58 +0000
commit10c39014e897d43e118e2ddd4f2c90b7de7ec517 (patch)
treeb27b56c7e70c4cd464b18be73aa7f4e416676b2e /include/cppunit/Portability.h
parent6943d47a76445bbfebc99859ed38698760354642 (diff)
downloadcppunit-10c39014e897d43e118e2ddd4f2c90b7de7ec517.tar.gz
Include/cppunit/config/Portability.
include/cppunit/config/Portability.h: If the compiler does not support namespace (CPPUNIT_HAVE_NAMESPACES=0), define CPPUNIT_NO_STD_NAMESPACE and CPPUNIT_NO_NAMESPACE. If CPPUNIT_NO_STD_NAMESPACE is defined, then CppUnit assumes that STL are in the global namespace. If CPPUNIT_NO_NAMESPACE is defined, then CppUnit classes are placed in the global namespace instead of the CppUnit namespace. * include/cppunit/config/config-bcb5.h: * include/cppunit/config/config-msvc6.h: added definition of macro CPPUNIT_HAVE_NAMESPACES. * include/cppunit/tools/StringTools.h: use CPPUNIT_WRAP_COLUMN as default parameter value for wrap(). * include/cppunit/*/*.h: * src/cppunit/*.cpp: changed all CppUnit namespace declaration to use macros CPPUNIT_NS_BEGIN and CPPUNIT_NS_END. Also, changed reference to CppUnit namespace (essentially in macros) using CPPUNIT_NS macro.
Diffstat (limited to 'include/cppunit/Portability.h')
-rw-r--r--include/cppunit/Portability.h34
1 files changed, 34 insertions, 0 deletions
diff --git a/include/cppunit/Portability.h b/include/cppunit/Portability.h
index 40c2a06..70f9e05 100644
--- a/include/cppunit/Portability.h
+++ b/include/cppunit/Portability.h
@@ -10,6 +10,11 @@
# include <cppunit/config-auto.h>
#endif
+// Version number of package
+#ifndef CPPUNIT_VERSION
+#define CPPUNIT_VERSION "1.9.9"
+#endif
+
#include <cppunit/config/CppUnitApi.h> // define CPPUNIT_API & CPPUNIT_NEED_DLL_DECL
#include <cppunit/config/SelectDllLoader.h>
@@ -37,6 +42,17 @@
#define CPPUNIT_HAVE_CPP_SOURCE_ANNOTATION 1
#endif
+/* Assumes that STL and CppUnit are in global space if the compiler does not
+ support namespace. */
+#if !defined(CPPUNIT_HAVE_NAMESPACES)
+#ifndef CPPUNIT_NO_NAMESPACE
+#define CPPUNIT_NO_NAMESPACE 1
+#endif // CPPUNIT_NO_NAMESPACE
+#ifndef CPPUNIT_NO_STD_NAMESPACE
+#define CPPUNIT_NO_STD_NAMESPACE 1
+#endif // CPPUNIT_NO_STD_NAMESPACE
+#endif // !defined(CPPUNIT_HAVE_NAMESPACES)
+
// Compiler error location format for CompilerOutputter
// If not define, assumes that it's gcc
// See class CompilerOutputter for format.
@@ -54,6 +70,24 @@
((TargetType)( pointer ))
#endif
+// If CPPUNIT_NO_STD_NAMESPACE is defined then STL are in the global space.
+// => Define macro 'std' to nothing
+#if defined(CPPUNIT_NO_STD_NAMESPACE)
+#undef std
+#define std
+#endif // defined(CPPUNIT_NO_STD_NAMESPACE)
+
+// If CPPUNIT_NO_NAMESPACE is defined, then put CppUnit classes in the
+// global namespace: the compiler does not support namespace.
+#if defined(CPPUNIT_NO_NAMESPACE)
+#define CPPUNIT_NS_BEGIN
+#define CPPUNIT_NS_END
+#define CPPUNIT_NS(symbol) symbol
+#else // defined(CPPUNIT_NO_NAMESPACE)
+#define CPPUNIT_NS_BEGIN namespace CppUnit {
+#define CPPUNIT_NS_END }
+#define CPPUNIT_NS(symbol) ::CppUnit::symbol
+#endif // defined(CPPUNIT_NO_NAMESPACE)
/*! Stringize a symbol.
*