From 2df2e1a1b971237373d44bbe406961808273345c Mon Sep 17 00:00:00 2001 From: Bogdan Cristea Date: Sat, 28 Dec 2013 22:31:58 +0200 Subject: [PATCH] corrected compilation on win8 with visual studio 2012 --- poppler/Annot.cc | 4 ++++ qt4/tests/stress-threads-qt4.cpp | 5 +++++ qt5/src/poppler-private.h | 5 +++-- qt5/tests/stress-threads-qt5.cpp | 5 +++++ 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/poppler/Annot.cc b/poppler/Annot.cc index 90a6e5d..8ae0aea 100644 --- a/poppler/Annot.cc +++ b/poppler/Annot.cc @@ -41,6 +41,10 @@ #pragma implementation #endif +#ifdef _WIN32 +#define NOMINMAX +#endif + #include #include #include diff --git a/qt4/tests/stress-threads-qt4.cpp b/qt4/tests/stress-threads-qt4.cpp index d4d5fa0..22f7f1e 100644 --- a/qt4/tests/stress-threads-qt4.cpp +++ b/qt4/tests/stress-threads-qt4.cpp @@ -1,5 +1,10 @@ +#ifndef _WIN32 #include +#else +#include +#define sleep Sleep +#endif #include #include diff --git a/qt5/src/poppler-private.h b/qt5/src/poppler-private.h index 0a132f0..c1f7588 100644 --- a/qt5/src/poppler-private.h +++ b/qt5/src/poppler-private.h @@ -84,9 +84,10 @@ namespace Poppler { init(); m_filePath = filePath; -#if defined(_WIN32) +#ifdef _WIN32 wchar_t *fileName = new WCHAR[filePath.length()]; - int length = filePath.toWCharArray(fileName); + std::wstring wstr = (const wchar_t *)filePath.utf16(); + int length = wstr._Copy_s(fileName, filePath.length(), filePath.length()); doc = new PDFDoc(fileName, length, ownerPassword, userPassword); delete[] fileName; #else diff --git a/qt5/tests/stress-threads-qt5.cpp b/qt5/tests/stress-threads-qt5.cpp index 2a24a35..36d75dc 100644 --- a/qt5/tests/stress-threads-qt5.cpp +++ b/qt5/tests/stress-threads-qt5.cpp @@ -1,5 +1,10 @@ +#ifndef _WIN32 #include +#else +#include +#define sleep Sleep +#endif #include #include -- 1.8.4.msysgit.0