summaryrefslogtreecommitdiffstats
path: root/Source/kwsys/kwsys_stl_string.hxx.in
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2007-04-19 15:21:35 (GMT)
committerBrad King <brad.king@kitware.com>2007-04-19 15:21:35 (GMT)
commit28f6b148f6a9241ede644aa2ca1497b86586eec2 (patch)
tree82bdaf290aab9c0fb38e90a0d3672ab7316b3d2a /Source/kwsys/kwsys_stl_string.hxx.in
parentaffd99a9a9a7896356ca3086b0a4634471386f2f (diff)
downloadCMake-28f6b148f6a9241ede644aa2ca1497b86586eec2.zip
CMake-28f6b148f6a9241ede644aa2ca1497b86586eec2.tar.gz
CMake-28f6b148f6a9241ede644aa2ca1497b86586eec2.tar.bz2
ENH: Fixed stl string streaming operators for Watcom.
Diffstat (limited to 'Source/kwsys/kwsys_stl_string.hxx.in')
-rw-r--r--Source/kwsys/kwsys_stl_string.hxx.in13
1 files changed, 12 insertions, 1 deletions
diff --git a/Source/kwsys/kwsys_stl_string.hxx.in b/Source/kwsys/kwsys_stl_string.hxx.in
index 3124c11..37e023f 100644
--- a/Source/kwsys/kwsys_stl_string.hxx.in
+++ b/Source/kwsys/kwsys_stl_string.hxx.in
@@ -29,6 +29,13 @@
# define @KWSYS_NAMESPACE@_STL_STRING_ISTREAM_DEFINED
# include <ctype.h> // isspace
# include <@KWSYS_NAMESPACE@/ios/iostream>
+# if defined(__WATCOMC__)
+namespace @KWSYS_NAMESPACE@
+{
+struct ios_istream_hack: public kwsys_ios::istream
+{ void eatwhite() { this->@KWSYS_NAMESPACE@_ios::istream::eatwhite(); } };
+}
+# endif
inline @KWSYS_NAMESPACE@_ios::istream&
operator>>(@KWSYS_NAMESPACE@_ios::istream& is,
@KWSYS_NAMESPACE@_stl::string& s)
@@ -43,8 +50,12 @@ operator>>(@KWSYS_NAMESPACE@_ios::istream& is,
s.erase();
// Skip leading whitespace.
+#if defined(__WATCOMC__)
+ static_cast<@KWSYS_NAMESPACE@::ios_istream_hack&>(is).eatwhite();
+#else
is.eatwhite();
- istream& okay = is;
+#endif
+ @KWSYS_NAMESPACE@_ios::istream& okay = is;
if(okay)
{