00001 #ifndef CPPUNIT_PORTABILITY_H
00002 #define CPPUNIT_PORTABILITY_H
00003
00004
00005 #if defined(__BORLANDC__)
00006 # include <cppunit/config-bcb5.h>
00007 #elif defined (_MSC_VER)
00008 # include <cppunit/config-msvc6.h>
00009 #else
00010 # include <cppunit/config-auto.h>
00011 #endif
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef CPPUNIT_ENABLE_NAKED_ASSERT
00022 #define CPPUNIT_ENABLE_NAKED_ASSERT 0
00023 #endif
00024
00025
00026
00027 #ifndef CPPUNIT_ENABLE_CU_TEST_MACROS
00028 #define CPPUNIT_ENABLE_CU_TEST_MACROS 0
00029 #endif
00030
00031
00032
00033 #ifndef CPPUNIT_HAVE_CPP_SOURCE_ANNOTATION
00034 #define CPPUNIT_HAVE_CPP_SOURCE_ANNOTATION 1
00035 #endif
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 #if CPPUNIT_HAVE_SSTREAM
00046 # include <sstream>
00047 namespace CppUnit {
00048 typedef std::ostringstream OStringStream;
00049 }
00050 #else
00051 #if CPPUNIT_HAVE_CLASS_STRSTREAM
00052 # include <string>
00053 # if CPPUNIT_HAVE_STRSTREAM
00054 # include <strstream>
00055 # else
00056 # include <strstream.h>
00057 # endif
00058
00059 namespace CppUnit {
00060 class OStringStream : public std::ostrstream
00061 {
00062 public:
00063 std::string str()
00064 {
00065 (*this) << '\0';
00066 std::string msg(std::ostrstream::str());
00067 std::ostrstream::freeze(false);
00068 return msg;
00069 }
00070 };
00071 }
00072 #else
00073 # error Cannot define CppUnit::OStringStream.
00074 #endif
00075 #endif
00076
00077
00078 #endif // CPPUNIT_PORTABILITY_H