From 13862ad8e65dd52d913d9a5512fc7a8721a6d289 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. --- 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 684d508659..8f7c2d43bb 100644 --- a/include/wx/stdpaths.h +++ b/include/wx/stdpaths.h @@ -194,6 +194,7 @@ protected: #elif defined(__UNIX__) #include "wx/unix/stdpaths.h" #define wxHAS_NATIVE_STDPATHS + #define wxHAS_STDPATHS_INSTALL_PREFIX #endif #endif @@ -205,6 +206,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 0cc98fbb95..96df133112 100644 --- a/src/common/translation.cpp +++ b/src/common/translation.cpp @@ -1803,7 +1803,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);