CppUnit project page FAQ CppUnit home page

Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Portability.h

Go to the documentation of this file.
00001 #ifndef CPPUNIT_PORTABILITY_H
00002 #define CPPUNIT_PORTABILITY_H
00003 
00004 #if defined(_WIN32) && !defined(WIN32)
00005 # define WIN32 1
00006 #endif
00007 
00008 /* include platform specific config */
00009 #if defined(__BORLANDC__)
00010 #  include <cppunit/config/config-bcb5.h>
00011 #elif defined (_MSC_VER)
00012 #  if _MSC_VER == 1200 && defined(_WIN32_WCE) //evc4
00013 #    include <cppunit/config/config-evc4.h>
00014 #  else
00015 #    include <cppunit/config/config-msvc6.h>
00016 #  endif
00017 #else
00018 #    include <cppunit/config-auto.h>
00019 #endif
00020 
00021 // Version number of package
00022 #ifndef CPPUNIT_VERSION 
00023 #define CPPUNIT_VERSION  "1.10.4"
00024 #endif
00025  
00026 #include <cppunit/config/CppUnitApi.h>    // define CPPUNIT_API & CPPUNIT_NEED_DLL_DECL
00027 #include <cppunit/config/SelectDllLoader.h>
00028 
00029 
00030 /* Options that the library user may switch on or off.
00031  * If the user has not done so, we chose default values.
00032  */
00033 
00034 
00035 /* Define to 1 if you wish to have the old-style macros
00036    assert(), assertEqual(), assertDoublesEqual(), and assertLongsEqual() */
00037 #if !defined(CPPUNIT_ENABLE_NAKED_ASSERT)
00038 # define CPPUNIT_ENABLE_NAKED_ASSERT          0
00039 #endif
00040 
00041 /* Define to 1 if you wish to have the old-style CU_TEST family
00042    of macros. */
00043 #if !defined(CPPUNIT_ENABLE_CU_TEST_MACROS)
00044 # define CPPUNIT_ENABLE_CU_TEST_MACROS        0
00045 #endif
00046 
00047 /* Define to 1 if the preprocessor expands (#foo) to "foo" (quotes incl.) 
00048    I don't think there is any C preprocess that does NOT support this! */
00049 #if !defined(CPPUNIT_HAVE_CPP_SOURCE_ANNOTATION)
00050 # define CPPUNIT_HAVE_CPP_SOURCE_ANNOTATION   1
00051 #endif
00052 
00053 /* Assumes that STL and CppUnit are in global space if the compiler does not
00054    support namespace. */
00055 #if !defined(CPPUNIT_HAVE_NAMESPACES)
00056 # if !defined(CPPUNIT_NO_NAMESPACE)
00057 #  define CPPUNIT_NO_NAMESPACE 1
00058 # endif // !defined(CPPUNIT_NO_NAMESPACE)
00059 # if !defined(CPPUNIT_NO_STD_NAMESPACE)
00060 #  define CPPUNIT_NO_STD_NAMESPACE 1
00061 # endif // !defined(CPPUNIT_NO_STD_NAMESPACE)
00062 #endif // !defined(CPPUNIT_HAVE_NAMESPACES)
00063 
00064 /* Define CPPUNIT_STD_NEED_ALLOCATOR to 1 if you need to specify
00065  * the allocator you used when instantiating STL container. Typically
00066  * used for compilers that do not support template default parameter.
00067  * CPPUNIT_STD_ALLOCATOR will be used as the allocator. Default is
00068  * std::allocator. On some compilers, you may need to change this to
00069  * std::allocator<T>.
00070  */
00071 #if CPPUNIT_STD_NEED_ALLOCATOR
00072 # if !defined(CPPUNIT_STD_ALLOCATOR)
00073 #  define CPPUNIT_STD_ALLOCATOR std::allocator
00074 # endif // !defined(CPPUNIT_STD_ALLOCATOR)
00075 #endif // defined(CPPUNIT_STD_NEED_ALLOCATOR)
00076 
00077 
00078 // Compiler error location format for CompilerOutputter
00079 // If not define, assumes that it's gcc
00080 // See class CompilerOutputter for format.
00081 #if !defined(CPPUNIT_COMPILER_LOCATION_FORMAT)
00082 #if defined(__GNUC__) && ( defined(__APPLE_CPP__) || defined(__APPLE_CC__) )
00083 // gcc/Xcode integration on Mac OS X
00084 # define CPPUNIT_COMPILER_LOCATION_FORMAT "%p:%l: " 
00085 #else
00086 # define CPPUNIT_COMPILER_LOCATION_FORMAT "%f:%l:"
00087 #endif
00088 #endif
00089 
00090 // If CPPUNIT_HAVE_CPP_CAST is defined, then c++ style cast will be used,
00091 // otherwise, C style cast are used.
00092 #if defined( CPPUNIT_HAVE_CPP_CAST )
00093 # define CPPUNIT_CONST_CAST( TargetType, pointer ) \
00094     const_cast<TargetType>( pointer )
00095 
00096 # define CPPUNIT_STATIC_CAST( TargetType, pointer ) \
00097     static_cast<TargetType>( pointer )
00098 #else // defined( CPPUNIT_HAVE_CPP_CAST )
00099 # define CPPUNIT_CONST_CAST( TargetType, pointer ) \
00100     ((TargetType)( pointer ))
00101 # define CPPUNIT_STATIC_CAST( TargetType, pointer ) \
00102     ((TargetType)( pointer ))
00103 #endif // defined( CPPUNIT_HAVE_CPP_CAST )
00104 
00105 // If CPPUNIT_NO_STD_NAMESPACE is defined then STL are in the global space.
00106 // => Define macro 'std' to nothing
00107 #if defined(CPPUNIT_NO_STD_NAMESPACE)
00108 # undef std
00109 # define std
00110 #endif  // defined(CPPUNIT_NO_STD_NAMESPACE)
00111 
00112 // If CPPUNIT_NO_NAMESPACE is defined, then put CppUnit classes in the
00113 // global namespace: the compiler does not support namespace.
00114 #if defined(CPPUNIT_NO_NAMESPACE)
00115 # define CPPUNIT_NS_BEGIN
00116 # define CPPUNIT_NS_END
00117 # define CPPUNIT_NS
00118 #else   // defined(CPPUNIT_NO_NAMESPACE)
00119 # define CPPUNIT_NS_BEGIN namespace CppUnit {
00120 # define CPPUNIT_NS_END }
00121 # define CPPUNIT_NS CppUnit
00122 #endif  // defined(CPPUNIT_NO_NAMESPACE)
00123 
00134 #define CPPUNIT_STRINGIZE( symbol ) _CPPUNIT_DO_STRINGIZE( symbol )
00135 
00137 #define _CPPUNIT_DO_STRINGIZE( symbol ) #symbol
00138 
00157 #define CPPUNIT_JOIN( symbol1, symbol2 ) _CPPUNIT_DO_JOIN( symbol1, symbol2 )
00158 
00160 #define _CPPUNIT_DO_JOIN( symbol1, symbol2 ) _CPPUNIT_DO_JOIN2( symbol1, symbol2 )
00161 
00163 #define _CPPUNIT_DO_JOIN2( symbol1, symbol2 ) symbol1##symbol2
00164 
00169 #define CPPUNIT_MAKE_UNIQUE_NAME( prefix ) CPPUNIT_JOIN( prefix, __LINE__ )
00170 
00173 #if !defined(CPPUNIT_WRAP_COLUMN)
00174 # define CPPUNIT_WRAP_COLUMN 79
00175 #endif
00176 
00177 #endif // CPPUNIT_PORTABILITY_H

SourceForge Logo hosts this site. Send comments to:
CppUnit Developers