1
// (C) Copyright Gennadiy Rozental 2005-2008.
2
// Distributed under the Boost Software License, Version 1.0.
3
// (See accompanying file LICENSE_1_0.txt or copy at
4
// http://www.boost.org/LICENSE_1_0.txt)
6
// See http://www.boost.org/libs/test for the library home page.
10
// Version : $Revision: 57992 $
12
// Description : Runtime.Param library configuration
13
// ***************************************************************************
15
#ifndef BOOST_RT_CONFIG_HPP_062604GER
16
#define BOOST_RT_CONFIG_HPP_062604GER
19
#include <boost/config.hpp>
21
# pragma warning(disable: 4511) // copy constructor could not be generated
22
# pragma warning(disable: 4512) // assignment operator could not be generated
23
# pragma warning(disable: 4181) // qualifier applied to reference type; ignored
24
# pragma warning(disable: 4675) // resolved overload was found by argument-dependent lookup
28
#include <boost/test/detail/config.hpp>
29
#include <boost/test/utils/basic_cstring/basic_cstring.hpp>
30
#include <boost/test/utils/wrap_stringstream.hpp>
31
#include <boost/test/utils/basic_cstring/io.hpp> // operator<<(boost::runtime::cstring)
37
//____________________________________________________________________________//
39
#ifndef BOOST_RT_PARAM_CUSTOM_STRING
40
# ifndef BOOST_RT_PARAM_WIDE_STRING
41
# define BOOST_RT_PARAM_NAMESPACE runtime
43
# define BOOST_RT_PARAM_NAMESPACE wide_runtime
48
extern int putenv(char*);
53
namespace BOOST_RT_PARAM_NAMESPACE {
55
#ifndef BOOST_RT_PARAM_CUSTOM_STRING
56
# ifndef BOOST_RT_PARAM_WIDE_STRING
58
typedef char char_type;
59
typedef std::string dstring;
60
typedef unit_test::const_string cstring;
61
typedef unit_test::literal_string literal_cstring;
62
typedef wrap_stringstream format_stream;
64
#ifdef BOOST_CLASSIC_IOSTREAMS
65
typedef std::ostream out_stream;
67
typedef std::basic_ostream<char_type> out_stream;
72
#pragma warning(disable:4996) // putenv
76
#if defined(__COMO__) && 0
78
putenv_impl( cstring name, cstring value )
81
// !! this may actually fail. What should we do?
82
setenv( name.begin(), value.begin(), 1 );
86
putenv_impl( cstring name, cstring value )
90
fs << name << '=' << value;
92
// !! this may actually fail. What should we do?
93
// const_cast is used to satisfy putenv interface
95
putenv( const_cast<char*>( fs.str().c_str() ) );
104
#define BOOST_RT_PARAM_LITERAL( l ) l
105
#define BOOST_RT_PARAM_CSTRING_LITERAL( l ) cstring( l, sizeof( l ) - 1 )
106
#define BOOST_RT_PARAM_GETENV getenv
107
#define BOOST_RT_PARAM_PUTENV ::boost::BOOST_RT_PARAM_NAMESPACE::putenv_impl
108
#define BOOST_RT_PARAM_EXCEPTION_INHERIT_STD
110
//____________________________________________________________________________//
114
typedef wchar_t char_type;
115
typedef std::basic_string<char_type> dstring;
116
typedef unit_test::basic_cstring<wchar_t const> cstring;
117
typedef const unit_test::basic_cstring<wchar_t const> literal_cstring;
118
typedef wrap_wstringstream format_stream;
119
typedef std::wostream out_stream;
123
putenv_impl( cstring name, cstring value )
127
fs << name << '=' << value;
129
// !! this may actually fail. What should we do?
130
// const_cast is used to satisfy putenv interface
132
wputenv( const_cast<wchar_t*>( fs.str().c_str() ) );
136
#define BOOST_RT_PARAM_LITERAL( l ) L ## l
137
#define BOOST_RT_PARAM_CSTRING_LITERAL( l ) cstring( L ## l, sizeof( L ## l )/sizeof(wchar_t) - 1 )
138
#define BOOST_RT_PARAM_GETENV wgetenv
139
#define BOOST_RT_PARAM_PUTENV putenv_impl
145
#define BOOST_RT_PARAM_UNNEEDED_VIRTUAL virtual
147
#define BOOST_RT_PARAM_UNNEEDED_VIRTUAL
150
//____________________________________________________________________________//
152
} // namespace BOOST_RT_PARAM_NAMESPACE
156
#endif // BOOST_RT_CONFIG_HPP_062604GER