diff --git a/include/tclap/StandardTraits.h b/include/tclap/StandardTraits.h index 8be880e..f63ed65 100644 --- a/include/tclap/StandardTraits.h +++ b/include/tclap/StandardTraits.h @@ -30,6 +30,15 @@ #include // To check for long long #endif +// If Microsoft has already typedef'd wchar_t as an unsigned +// short, then compiles will break because it's as if we're +// creating ArgTraits twice for unsigned short. Thus... +#ifdef _MSC_VER +#ifndef _NATIVE_WCHAR_T_DEFINED +#define TCLAP_DONT_DECLARE_WCHAR_T_ARGTRAITS +#endif +#endif + namespace TCLAP { // ====================================================================== @@ -156,13 +165,16 @@ struct ArgTraits { typedef ValueLike ValueCategory; }; + /** * wchar_ts have value-like semantics. */ +#ifndef TCLAP_DONT_DECLARE_WCHAR_T_ARGTRAITS template<> struct ArgTraits { typedef ValueLike ValueCategory; }; +#endif /** * Strings have string like argument traits.