diff options
Diffstat (limited to 'Source/kwsys/kwsys_stl_string.hxx.in')
-rw-r--r-- | Source/kwsys/kwsys_stl_string.hxx.in | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/Source/kwsys/kwsys_stl_string.hxx.in b/Source/kwsys/kwsys_stl_string.hxx.in index 7d45649..2061c18 100644 --- a/Source/kwsys/kwsys_stl_string.hxx.in +++ b/Source/kwsys/kwsys_stl_string.hxx.in @@ -90,3 +90,22 @@ operator<<(@KWSYS_NAMESPACE@_ios::ostream& os, return os << s.c_str(); } #endif + +// Provide the operator!= for the stl string and char* if it is not +// provided by the system or another copy of kwsys. Allow user code +// to block this definition by defining the macro +// @KWSYS_NAMESPACE@_STL_STRING_NO_NEQ_CHAR +// to avoid conflicts with other libraries. +#if !@KWSYS_NAMESPACE@_STL_STRING_HAVE_NEQ_CHAR && \ + !defined(@KWSYS_NAMESPACE@_STL_STRING_NO_NEQ_CHAR) && \ + !defined(KWSYS_STL_STRING_NEQ_CHAR_DEFINED) +# define KWSYS_STL_STRING_NEQ_CHAR_DEFINED +inline bool operator!=(@KWSYS_NAMESPACE@_stl::string const& s, const char* c) +{ + return !(s == c); +} +inline bool operator!=(const char* c, @KWSYS_NAMESPACE@_stl::string const& s) +{ + return !(s == c); +} +#endif |