From a068a09a8f8b7e7a67d23273fcefb3739dc30458 Mon Sep 17 00:00:00 2001 From: sovrasov Date: Thu, 27 Oct 2016 22:05:27 +0300 Subject: [PATCH] Fix build on MSVC --- cmdline.h | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/cmdline.h b/cmdline.h index de9eaf7..fbe71cd 100644 --- a/cmdline.h +++ b/cmdline.h @@ -36,7 +36,9 @@ #include #include #include +#ifndef _MSC_VER #include +#endif #include namespace cmdline{ @@ -51,7 +53,7 @@ class lexical_cast_t{ std::stringstream ss; if (!(ss<>ret && ss.eof())) throw std::bad_cast(); - + return ret; } }; @@ -61,7 +63,7 @@ class lexical_cast_t{ public: static Target cast(const Source &arg){ return arg; - } + } }; template @@ -102,6 +104,7 @@ Target lexical_cast(const Source &arg) return lexical_cast_t::value>::cast(arg); } +#ifndef _MSC_VER static inline std::string demangle(const std::string &name) { int status=0; @@ -110,6 +113,12 @@ static inline std::string demangle(const std::string &name) free(p); return ret; } +#else +static inline std::string demangle(const std::string &name) +{ + return name; +} +#endif template std::string readable_typename() @@ -560,7 +569,7 @@ class parser{ if (ordered[i]->must()) oss<short_description()<<" "; } - + oss<<"[options] ... "<