Last change
on this file since 33 was
29,
checked in by landauf, 17 years ago
|
updated boost from 1_33_1 to 1_34_1
|
File size:
1.3 KB
|
Line | |
---|
1 | /*============================================================================= |
---|
2 | Copyright (c) 2003 Martin Wille |
---|
3 | http://spirit.sourceforge.net/ |
---|
4 | |
---|
5 | Use, modification and distribution is subject to the Boost Software |
---|
6 | License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at |
---|
7 | http://www.boost.org/LICENSE_1_0.txt) |
---|
8 | =============================================================================*/ |
---|
9 | #include <boost/config.hpp> |
---|
10 | |
---|
11 | /////////////////////////////////////////////////////////////////////////// |
---|
12 | // workaround for prestandard support of stringstreams |
---|
13 | // |
---|
14 | // * defines sstream_t for the string stream type |
---|
15 | // * defines std::string getstring(sstream_t &); |
---|
16 | // |
---|
17 | |
---|
18 | #ifdef BOOST_NO_STRINGSTREAM |
---|
19 | # include <strstream> |
---|
20 | typedef strstream sstream_t; |
---|
21 | std::string |
---|
22 | getstring(std::strstream& ss) |
---|
23 | { |
---|
24 | ss << ends; |
---|
25 | std::string rval = ss.str(); |
---|
26 | ss.freeze(false); |
---|
27 | return rval; |
---|
28 | } |
---|
29 | #else |
---|
30 | # include <sstream> |
---|
31 | typedef std::stringstream sstream_t; |
---|
32 | std::string |
---|
33 | getstring(std::stringstream &ss) |
---|
34 | { |
---|
35 | return ss.str(); |
---|
36 | } |
---|
37 | #endif |
---|
38 | |
---|
39 | void use_getstring_to_avoid_compiler_warnings_about_unused_functions() |
---|
40 | { |
---|
41 | sstream_t ss; |
---|
42 | getstring(ss); |
---|
43 | if(!ss) { // to be not recursive on all control paths |
---|
44 | use_getstring_to_avoid_compiler_warnings_about_unused_functions(); |
---|
45 | } |
---|
46 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.