From 6866cfacc21be88b033288b13cb3aa17469ea24f Mon Sep 17 00:00:00 2001 From: Hib Eris Date: Thu, 19 Jun 2014 21:12:20 +0200 Subject: [PATCH] qt5: Fix compiling with mingw compiler The function _Copy_s is only available for MS Visual C compilers. Reverts 31edf585e62f4e91b7b64295cc8b978ac466ce58 for non MSVC compilers. https://bugs.freedesktop.org/show_bug.cgi?id=80251 --- qt5/src/poppler-private.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/qt5/src/poppler-private.h b/qt5/src/poppler-private.h index 0dd40d7..c002548 100644 --- a/qt5/src/poppler-private.h +++ b/qt5/src/poppler-private.h @@ -87,8 +87,12 @@ namespace Poppler { #ifdef _WIN32 wchar_t *fileName = new WCHAR[filePath.length()]; +#ifdef _MSC_VER std::wstring wstr = (const wchar_t *)filePath.utf16(); int length = wstr._Copy_s(fileName, filePath.length(), filePath.length()); +#else + int length = filePath.toWCharArray(fileName); +#endif doc = new PDFDoc(fileName, length, ownerPassword, userPassword); delete[] fileName; #else -- 1.8.3.2