From cb1517921f7afaeb39a393148bfdbd342abe4f87 Mon Sep 17 00:00:00 2001 From: mes5k Date: Sat, 30 Oct 2004 22:26:58 +0000 Subject: [PATCH] yet another fix for HAVE_SSTREAM stuff --- include/tclap/MultiArg.h | 22 ++++++++-------------- include/tclap/ValueArg.h | 20 +++++++------------- 2 files changed, 15 insertions(+), 27 deletions(-) diff --git a/include/tclap/MultiArg.h b/include/tclap/MultiArg.h index 53346a3..045dda3 100644 --- a/include/tclap/MultiArg.h +++ b/include/tclap/MultiArg.h @@ -38,6 +38,8 @@ #include #elif defined(HAVE_STRSTREAM) #include +#else +#error "Need a stringstream (sstream or strstream) to compile!" #endif namespace TCLAP { @@ -85,16 +87,12 @@ class ValueExtractor { T temp; -#ifdef HAVE_SSTREAM +#if defined(HAVE_SSTREAM) std::istringstream is(val); -#elif HAVE_STRSTREAM +#elif defined(HAVE_STRSTREAM) std::istrstream is(val.c_str()); #else - throw(SpecificationException( - string("Missing sstream or strstream lib, ") + - "without which, nothing will work. " + - "Not even sure how you got this far!", - toString())); +#error "Need a stringstream (sstream or strstream) to compile!" #endif int valuesRead = 0; @@ -350,16 +348,12 @@ void MultiArg::allowedInit() for ( unsigned int i = 0; i < _allowed.size(); i++ ) { -#ifdef HAVE_SSTREAM +#if defined(HAVE_SSTREAM) std::ostringstream os; -#elif HAVE_STRSTREAM +#elif defined(HAVE_STRSTREAM) std::ostrstream os; #else - throw(SpecificationException( - string("Missing sstream or strstream lib, ") + - "without which, nothing will work. " + - "Not even sure how you got this far!", - toString())); +#error "Need a stringstream (sstream or strstream) to compile!" #endif os << _allowed[i]; diff --git a/include/tclap/ValueArg.h b/include/tclap/ValueArg.h index 744f1db..e1f8835 100644 --- a/include/tclap/ValueArg.h +++ b/include/tclap/ValueArg.h @@ -38,6 +38,8 @@ #include #elif defined(HAVE_STRSTREAM) #include +#else +#error "Need a stringstream (sstream or strstream) to compile!" #endif namespace TCLAP { @@ -86,16 +88,12 @@ template class ValueExtractor int extractValue( const std::string& val ) { -#ifdef HAVE_SSTREAM +#if defined(HAVE_SSTREAM) std::istringstream is(val); -#elif HAVE_STRSTREAM +#elif defined(HAVE_STRSTREAM) std::istrstream is(val.c_str()); #else - throw(SpecificationException( - string("Missing sstream or strstream lib, ") + - "without which, nothing will work. " + - "Not even sure how you got this far!", - toString())); +#error "Need a stringstream (sstream or strstream) to compile!" #endif int valuesRead = 0; @@ -381,16 +379,12 @@ void ValueArg::allowedInit() for ( unsigned int i = 0; i < _allowed.size(); i++ ) { -#ifdef HAVE_SSTREAM +#if defined(HAVE_SSTREAM) std::ostringstream os; #elif defined(HAVE_STRSTREAM) std::ostrstream os; #else - throw(SpecificationException( - string("Missing sstream or strstream lib, ") + - "without which, nothing will work. " + - "Not even sure how you got this far!", - toString())); +#error "Need a stringstream (sstream or strstream) to compile!" #endif os << _allowed[i];