diff --git a/src/common/arrstr.cpp b/src/common/arrstr.cpp index 45262b2dce..dc569a80bf 100644 --- a/src/common/arrstr.cpp +++ b/src/common/arrstr.cpp @@ -27,8 +27,20 @@ #if defined( __WINDOWS__ ) #include -#endif + // In some distributions of MinGW32, this function is exported in the library, + // but not declared in shlwapi.h. Therefore we declare it here. + #if defined( __MINGW32_TOOLCHAIN__ ) + extern "C" __declspec(dllimport) int WINAPI StrCmpLogicalW(LPCWSTR psz1, LPCWSTR psz2); + #endif + + // For MSVC we can also link the library containing StrCmpLogicalW() + // directly from here, for the other compilers this needs to be done at + // makefiles level. + #ifdef __VISUALC__ + #pragma comment(lib, "shlwapi") + #endif +#endif // ============================================================================ // ArrayString @@ -892,17 +904,6 @@ int wxCMPFUNC_CONV wxCmpNaturalGeneric(const wxString& s1, const wxString& s2) return comparison; } -// ---------------------------------------------------------------------------- -// Declaration of StrCmpLogicalW() -// ---------------------------------------------------------------------------- -// -// In some distributions of MinGW32, this function is exported in the library, -// but not declared in shlwapi.h. Therefore we declare it here. -#if defined( __MINGW32_TOOLCHAIN__ ) - extern "C" __declspec(dllimport) int WINAPI StrCmpLogicalW(LPCWSTR psz1, LPCWSTR psz2); -#endif - - // ---------------------------------------------------------------------------- // wxCmpNatural // ----------------------------------------------------------------------------