From 723489e2d946d7be46cbaf3b6d5b9fd6fc6ca65a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Va=CC=81clav=20Slavi=CC=81k?= Date: Sun, 11 Dec 2016 15:18:24 +0100 Subject: [PATCH] Fix GetInstallPrefix availability check Add wxHAS_STDPATHS_INSTALL_PREFIX to make checking for wxStandardPaths::GetInstallPrefix()'s availability simpler, as the condition under which it is compiled is nontrivial. Fixes compilation after 2c24ee9216d9a41cc2a7b4ec292103eadba14176 on Cygwin, which is a UNIX, but its wxStandardPaths implementation is a Windows one. (cherry picked from commit 13862ad8e65dd52d913d9a5512fc7a8721a6d289) --- include/wx/stdpaths.h | 2 ++ src/common/translation.cpp | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/wx/stdpaths.h b/include/wx/stdpaths.h index 9d92044457..952f8818a3 100644 --- a/include/wx/stdpaths.h +++ b/include/wx/stdpaths.h @@ -184,6 +184,7 @@ protected: #elif defined(__UNIX__) #include "wx/unix/stdpaths.h" #define wxHAS_NATIVE_STDPATHS + #define wxHAS_STDPATHS_INSTALL_PREFIX #endif #endif @@ -195,6 +196,7 @@ protected: // wxUSE_STDPATHS=0, so that our code can still use wxStandardPaths. #ifndef wxHAS_NATIVE_STDPATHS +#define wxHAS_STDPATHS_INSTALL_PREFIX class WXDLLIMPEXP_BASE wxStandardPaths : public wxStandardPathsBase { public: diff --git a/src/common/translation.cpp b/src/common/translation.cpp index 4b7c177cc9..0665483a8e 100644 --- a/src/common/translation.cpp +++ b/src/common/translation.cpp @@ -1813,7 +1813,7 @@ wxArrayString GetSearchPrefixes() if ( paths.Index(stdp) == wxNOT_FOUND ) paths.Add(stdp); - #if defined(__UNIX__) && !defined(__WXOSX_COCOA__) && !defined(__WXOSX_IPHONE__) && !defined(__DARWIN__) + #ifdef wxHAS_STDPATHS_INSTALL_PREFIX stdp = wxStandardPaths::Get().GetInstallPrefix() + "/share/locale"; if ( paths.Index(stdp) == wxNOT_FOUND ) paths.Add(stdp);