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 #ifndef CPPUNIT_API
00039 #define CPPUNIT_API
00040 #undef CPPUNIT_NEED_DLL_DECL
00041 #define CPPUNIT_NEED_DLL_DECL 0
00042 #endif
00043
00044
00045
00046
00047
00048
00049
00050
00051 #if CPPUNIT_HAVE_SSTREAM
00052 # include <sstream>
00053 namespace CppUnit {
00054 class OStringStream : public std::ostringstream
00055 {
00056 };
00057 }
00058 #else
00059 #if CPPUNIT_HAVE_CLASS_STRSTREAM
00060 # include <string>
00061 # if CPPUNIT_HAVE_STRSTREAM
00062 # include <strstream>
00063 # else
00064 # include <strstream.h>
00065 # endif
00066
00067 namespace CppUnit {
00068 class OStringStream : public std::ostrstream
00069 {
00070 public:
00071 std::string str()
00072 {
00073 (*this) << '\0';
00074 std::string msg(std::ostrstream::str());
00075 std::ostrstream::freeze(false);
00076 return msg;
00077 }
00078 };
00079 }
00080 #else
00081 # error Cannot define CppUnit::OStringStream.
00082 #endif
00083 #endif
00084
00085 #endif // CPPUNIT_PORTABILITY_H