mirror of
https://github.com/cuberite/TCLAP.git
synced 2025-09-10 12:49:08 -04:00
added a check for wchar_t to deal with a potential problem with MS compilers
This commit is contained in:
parent
801d893678
commit
ab82cc7f87
@ -30,6 +30,15 @@
|
|||||||
#include <config.h> // To check for long long
|
#include <config.h> // To check for long long
|
||||||
#endif
|
#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 {
|
namespace TCLAP {
|
||||||
|
|
||||||
// ======================================================================
|
// ======================================================================
|
||||||
@ -156,13 +165,16 @@ struct ArgTraits<bool> {
|
|||||||
typedef ValueLike ValueCategory;
|
typedef ValueLike ValueCategory;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* wchar_ts have value-like semantics.
|
* wchar_ts have value-like semantics.
|
||||||
*/
|
*/
|
||||||
|
#ifndef TCLAP_DONT_DECLARE_WCHAR_T_ARGTRAITS
|
||||||
template<>
|
template<>
|
||||||
struct ArgTraits<wchar_t> {
|
struct ArgTraits<wchar_t> {
|
||||||
typedef ValueLike ValueCategory;
|
typedef ValueLike ValueCategory;
|
||||||
};
|
};
|
||||||
|
#endif
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Strings have string like argument traits.
|
* Strings have string like argument traits.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user