annotate DEPENDENCIES/generic/include/boost/test/utils/runtime/config.hpp @ 133:4acb5d8d80b6 tip

Don't fail environmental check if README.md exists (but .txt and no-suffix don't)
author Chris Cannam
date Tue, 30 Jul 2019 12:25:44 +0100
parents c530137014c0
children
rev   line source
Chris@16 1 // (C) Copyright Gennadiy Rozental 2005-2008.
Chris@16 2 // Distributed under the Boost Software License, Version 1.0.
Chris@16 3 // (See accompanying file LICENSE_1_0.txt or copy at
Chris@16 4 // http://www.boost.org/LICENSE_1_0.txt)
Chris@16 5
Chris@16 6 // See http://www.boost.org/libs/test for the library home page.
Chris@16 7 //
Chris@16 8 // File : $RCSfile$
Chris@16 9 //
Chris@101 10 // Version : $Revision$
Chris@16 11 //
Chris@16 12 // Description : Runtime.Param library configuration
Chris@16 13 // ***************************************************************************
Chris@16 14
Chris@16 15 #ifndef BOOST_RT_CONFIG_HPP_062604GER
Chris@16 16 #define BOOST_RT_CONFIG_HPP_062604GER
Chris@16 17
Chris@16 18 // Boost
Chris@16 19 #include <boost/config.hpp>
Chris@16 20 #ifdef BOOST_MSVC
Chris@16 21 # pragma warning(disable: 4511) // copy constructor could not be generated
Chris@16 22 # pragma warning(disable: 4512) // assignment operator could not be generated
Chris@16 23 # pragma warning(disable: 4181) // qualifier applied to reference type; ignored
Chris@16 24 # pragma warning(disable: 4675) // resolved overload was found by argument-dependent lookup
Chris@16 25 #endif
Chris@16 26
Chris@16 27 // Boost.Test
Chris@16 28 #include <boost/test/detail/config.hpp>
Chris@16 29 #include <boost/test/utils/basic_cstring/basic_cstring.hpp>
Chris@16 30 #include <boost/test/utils/wrap_stringstream.hpp>
Chris@16 31 #include <boost/test/utils/basic_cstring/io.hpp> // operator<<(boost::runtime::cstring)
Chris@16 32
Chris@16 33 // STL
Chris@16 34 #include <string>
Chris@16 35 #include <cstdlib>
Chris@16 36
Chris@16 37 //____________________________________________________________________________//
Chris@16 38
Chris@16 39 #ifndef BOOST_RT_PARAM_CUSTOM_STRING
Chris@16 40 # ifndef BOOST_RT_PARAM_WIDE_STRING
Chris@16 41 # define BOOST_RT_PARAM_NAMESPACE runtime
Chris@16 42 # else
Chris@16 43 # define BOOST_RT_PARAM_NAMESPACE wide_runtime
Chris@16 44 # endif
Chris@16 45 #endif
Chris@16 46
Chris@16 47 #ifdef __SUNPRO_CC
Chris@16 48 extern int putenv(char*);
Chris@16 49 #endif
Chris@16 50
Chris@16 51 namespace boost {
Chris@16 52
Chris@16 53 namespace BOOST_RT_PARAM_NAMESPACE {
Chris@16 54
Chris@16 55 #ifndef BOOST_RT_PARAM_CUSTOM_STRING
Chris@16 56 # ifndef BOOST_RT_PARAM_WIDE_STRING
Chris@16 57
Chris@16 58 typedef char char_type;
Chris@16 59 typedef std::string dstring;
Chris@16 60 typedef unit_test::const_string cstring;
Chris@16 61 typedef unit_test::literal_string literal_cstring;
Chris@16 62 typedef wrap_stringstream format_stream;
Chris@16 63
Chris@16 64 #ifdef BOOST_CLASSIC_IOSTREAMS
Chris@16 65 typedef std::ostream out_stream;
Chris@16 66 #else
Chris@16 67 typedef std::basic_ostream<char_type> out_stream;
Chris@16 68 #endif
Chris@16 69
Chris@16 70 #ifdef BOOST_MSVC
Chris@16 71 #pragma warning(push)
Chris@16 72 #pragma warning(disable:4996) // putenv
Chris@16 73 #endif
Chris@16 74
Chris@16 75 #ifndef UNDER_CE
Chris@16 76 #if defined(__COMO__) && 0
Chris@16 77 inline void
Chris@16 78 putenv_impl( cstring name, cstring value )
Chris@16 79 {
Chris@16 80 using namespace std;
Chris@16 81 // !! this may actually fail. What should we do?
Chris@16 82 setenv( name.begin(), value.begin(), 1 );
Chris@16 83 }
Chris@16 84 #else
Chris@16 85 inline void
Chris@16 86 putenv_impl( cstring name, cstring value )
Chris@16 87 {
Chris@16 88 format_stream fs;
Chris@16 89
Chris@16 90 fs << name << '=' << value;
Chris@16 91
Chris@16 92 // !! this may actually fail. What should we do?
Chris@16 93 // const_cast is used to satisfy putenv interface
Chris@16 94 using namespace std;
Chris@16 95 putenv( const_cast<char*>( fs.str().c_str() ) );
Chris@16 96 }
Chris@16 97 #endif
Chris@16 98 #endif
Chris@16 99
Chris@16 100 #ifdef BOOST_MSVC
Chris@16 101 #pragma warning(pop)
Chris@16 102 #endif
Chris@16 103
Chris@16 104 #define BOOST_RT_PARAM_LITERAL( l ) l
Chris@16 105 #define BOOST_RT_PARAM_CSTRING_LITERAL( l ) cstring( l, sizeof( l ) - 1 )
Chris@16 106 #define BOOST_RT_PARAM_GETENV getenv
Chris@16 107 #define BOOST_RT_PARAM_PUTENV ::boost::BOOST_RT_PARAM_NAMESPACE::putenv_impl
Chris@16 108 #define BOOST_RT_PARAM_EXCEPTION_INHERIT_STD
Chris@16 109
Chris@16 110 //____________________________________________________________________________//
Chris@16 111
Chris@16 112 # else
Chris@16 113
Chris@16 114 typedef wchar_t char_type;
Chris@16 115 typedef std::basic_string<char_type> dstring;
Chris@16 116 typedef unit_test::basic_cstring<wchar_t const> cstring;
Chris@16 117 typedef const unit_test::basic_cstring<wchar_t const> literal_cstring;
Chris@16 118 typedef wrap_wstringstream format_stream;
Chris@16 119 typedef std::wostream out_stream;
Chris@16 120
Chris@16 121 #ifndef UNDER_CE
Chris@16 122 inline void
Chris@16 123 putenv_impl( cstring name, cstring value )
Chris@16 124 {
Chris@16 125 format_stream fs;
Chris@16 126
Chris@16 127 fs << name << '=' << value;
Chris@16 128
Chris@16 129 // !! this may actually fail. What should we do?
Chris@16 130 // const_cast is used to satisfy putenv interface
Chris@16 131 using namespace std;
Chris@16 132 wputenv( const_cast<wchar_t*>( fs.str().c_str() ) );
Chris@16 133 }
Chris@16 134 #endif
Chris@16 135
Chris@16 136 #define BOOST_RT_PARAM_LITERAL( l ) L ## l
Chris@16 137 #define BOOST_RT_PARAM_CSTRING_LITERAL( l ) cstring( L ## l, sizeof( L ## l )/sizeof(wchar_t) - 1 )
Chris@16 138 #define BOOST_RT_PARAM_GETENV wgetenv
Chris@16 139 #define BOOST_RT_PARAM_PUTENV putenv_impl
Chris@16 140
Chris@16 141 # endif
Chris@16 142 #endif
Chris@16 143
Chris@16 144 #ifdef __GNUC__
Chris@16 145 #define BOOST_RT_PARAM_UNNEEDED_VIRTUAL virtual
Chris@16 146 #else
Chris@16 147 #define BOOST_RT_PARAM_UNNEEDED_VIRTUAL
Chris@16 148 #endif
Chris@16 149
Chris@16 150 //____________________________________________________________________________//
Chris@16 151
Chris@16 152 } // namespace BOOST_RT_PARAM_NAMESPACE
Chris@16 153
Chris@16 154 } // namespace boost
Chris@16 155
Chris@16 156 #endif // BOOST_RT_CONFIG_HPP_062604GER