From e57435c0fcee35da204d68574cdc775b48beefd4 Mon Sep 17 00:00:00 2001 From: jean-pierre charras Date: Fri, 13 Apr 2018 11:06:46 +0200 Subject: [PATCH] Fix compil issue (created by commit "Added std::less specialization for wxPoint") with wxWidgets 3.1.1 --- common/common.cpp | 2 ++ include/common.h | 9 +++++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/common/common.cpp b/common/common.cpp index 8c5c058a00..f5b8abce42 100644 --- a/common/common.cpp +++ b/common/common.cpp @@ -388,6 +388,7 @@ size_t std::hash::operator()( const wxString& s ) const #endif +#ifdef USE_KICAD_WXPOINT_LESS bool std::less::operator()( const wxPoint& aA, const wxPoint& aB ) const { if( aA.x == aB.x ) @@ -395,3 +396,4 @@ bool std::less::operator()( const wxPoint& aA, const wxPoint& aB ) cons return aA.x < aB.x; } +#endif diff --git a/include/common.h b/include/common.h index 1fb3d5d12f..47dc3cb7a4 100644 --- a/include/common.h +++ b/include/common.h @@ -355,13 +355,18 @@ namespace std { size_t operator()( const wxString& s ) const; }; +} +#endif +/// Required to use wxPoint as key type in maps +#define USE_KICAD_WXPOINT_LESS // for common.cpp +namespace std +{ template<> struct less { bool operator()( const wxPoint& aA, const wxPoint& aB ) const; }; - } -#endif + #endif // INCLUDE__COMMON_H_