mirror of
https://github.com/wxWidgets/wxWidgets.git
synced 2026-09-23 06:33:59 +08:00
Fix compilation of stream position checks with MSVC
CHECK(pubseekoff(...) == int) failed to compile because of an ambiguity due to multiple overloaded operator==()s in MSVC CRT. Add a global operator==() overload matching the actual types to help this compiler to do the right thing. This should be reverted when support for MSVS 2015 is dropped.
This commit is contained in:
@@ -51,6 +51,16 @@ protected:
|
||||
|
||||
} // anonymous namespace
|
||||
|
||||
// MSVS 2015 can't compile CHECK()s in this file without this disambiguation.
|
||||
#ifdef __VISUALC__
|
||||
#if __VISUALC__ < 1910
|
||||
inline bool operator==(const std::fpos<_Mbstatet> lhs, const int rhs)
|
||||
{
|
||||
return static_cast<int>(lhs) == rhs;
|
||||
}
|
||||
#endif // MSVS 2015
|
||||
#endif // __VISUALC__
|
||||
|
||||
// ==========================================================================
|
||||
// Tests
|
||||
// ==========================================================================
|
||||
|
||||
Reference in New Issue
Block a user