From 9ddcd853acd955476ceea8aa79b32089eb26cf7c 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, 11 insertions(+), 3 deletions(-) diff --git a/poppler/Annot.cc b/poppler/Annot.cc index 90a6e5d..8d7520d 100644 --- a/poppler/Annot.cc +++ b/poppler/Annot.cc @@ -3388,7 +3388,9 @@ void AnnotLine::setIntent(AnnotLineIntent new_intent) { obj1.initName("LineDimension"); update ("IT", &obj1); } - +#ifdef _MSC_VER +#undef max +#endif void AnnotLine::generateLineAppearance() { double borderWidth, ca = opacity; 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