From 233862f875e384b4a2e1e1ec204c46c9eb5101a0 Mon Sep 17 00:00:00 2001 From: Bogdan Cristea Date: Sat, 28 Dec 2013 22:31:58 +0200 Subject: [PATCH] corrected com on win with visual studio 2012 --- poppler/Annot.cc | 4 ++++ qt5/src/poppler-private.h | 5 +++-- qt5/tests/stress-threads-qt5.cpp | 5 +++++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/poppler/Annot.cc b/poppler/Annot.cc index 90a6e5d..5338ffc 100644 --- a/poppler/Annot.cc +++ b/poppler/Annot.cc @@ -41,6 +41,10 @@ #pragma implementation #endif +#ifdef _MSC_VER +#define NOMINMAX +#endif + #include #include #include diff --git a/qt5/src/poppler-private.h b/qt5/src/poppler-private.h index 0a132f0..8b463e0 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 _MSC_VER 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..115f8ae 100644 --- a/qt5/tests/stress-threads-qt5.cpp +++ b/qt5/tests/stress-threads-qt5.cpp @@ -1,5 +1,10 @@ +#ifndef _MSC_VER #include +#else +#include +#define sleep Sleep +#endif #include #include -- 1.8.4.msysgit.0