1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85
#ifndef CPPUNIT_PORTABILITY_H
#define CPPUNIT_PORTABILITY_H
/* include platform specific config */
#if defined(__BORLANDC__)
# include <cppunit/config-bcb5.h>
#elif defined (_MSC_VER)
# include <cppunit/config-msvc6.h>
#else
# include <cppunit/config-auto.h>
#endif
/* Options that the library user may switch on or off.
* If the user has not done so, we chose default values.
*/
/* Define to 1 if you wish to have the old-style macros
assert(), assertEqual(), assertDoublesEqual(), and assertLongsEqual() */
#ifndef CPPUNIT_ENABLE_NAKED_ASSERT
#define CPPUNIT_ENABLE_NAKED_ASSERT 0
#endif
/* Define to 1 if you wish to have the old-style CU_TEST family
of macros. */
#ifndef CPPUNIT_ENABLE_CU_TEST_MACROS
#define CPPUNIT_ENABLE_CU_TEST_MACROS 0
#endif
/* Define to 1 if the preprocessor expands (#foo) to "foo" (quotes incl.)
I don't think there is any C preprocess that does NOT support this! */
#ifndef CPPUNIT_HAVE_CPP_SOURCE_ANNOTATION
#define CPPUNIT_HAVE_CPP_SOURCE_ANNOTATION 1
#endif
// CPPUNIT_API is defined in <config_msvc6.h> if required (building or using as dll)
#ifndef CPPUNIT_API
#define CPPUNIT_API
#undef CPPUNIT_NEED_DLL_DECL
#define CPPUNIT_NEED_DLL_DECL 0
#endif
/* perform portability hacks */
/* Define CPPUNIT_SSTREAM as a stream with a "std::string str()"
* method.
*/
#if CPPUNIT_HAVE_SSTREAM
# include <sstream>
namespace CppUnit {
class OStringStream : public std::ostringstream
{
};
}
#else
#if CPPUNIT_HAVE_CLASS_STRSTREAM
# include <string>
# if CPPUNIT_HAVE_STRSTREAM
# include <strstream>
# else
# include <strstream.h>
# endif
namespace CppUnit {
class OStringStream : public std::ostrstream
{
public:
std::string str()
{
(*this) << '\0';
std::string msg(std::ostrstream::str());
std::ostrstream::freeze(false);
return msg;
}
};
}
#else
# error Cannot define CppUnit::OStringStream.
#endif
#endif
#endif // CPPUNIT_PORTABILITY_H