[poppler] goo/gfile.h goo/GooMutex.h goo/GooTimer.h poppler/PDFDoc.cc poppler/poppler-config.h.cmake poppler/poppler-config.h.in poppler/XpdfPluginAPI.h qt4/tests qt5/src qt5/tests test/perf-test.cc

Albert Astals Cid aacid at kemper.freedesktop.org
Mon Jan 27 11:06:51 PST 2014


 goo/GooMutex.h                   |    3 ++-
 goo/GooTimer.h                   |    2 ++
 goo/gfile.h                      |    2 ++
 poppler/PDFDoc.cc                |    4 +---
 poppler/XpdfPluginAPI.h          |    2 ++
 poppler/poppler-config.h.cmake   |   18 ++++++++++++++++--
 poppler/poppler-config.h.in      |   18 ++++++++++++++++--
 qt4/tests/stress-threads-qt4.cpp |    5 +++++
 qt5/src/poppler-private.h        |    6 ++++--
 qt5/tests/stress-threads-qt5.cpp |    5 +++++
 test/perf-test.cc                |    1 -
 11 files changed, 55 insertions(+), 11 deletions(-)

New commits:
commit 31edf585e62f4e91b7b64295cc8b978ac466ce58
Author: Bogdan Cristea <cristeab at gmail.com>
Date:   Mon Jan 27 20:06:11 2014 +0100

    [qt] Improve compilation under Win 8 with Visual Studio 2012
    
    Bug #73111

diff --git a/goo/GooMutex.h b/goo/GooMutex.h
index e9d5a54..4a7ed5f 100644
--- a/goo/GooMutex.h
+++ b/goo/GooMutex.h
@@ -19,6 +19,7 @@
 // Copyright (C) 2013 Thomas Freitag <Thomas.Freitag at alfa.de>
 // Copyright (C) 2013 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2013 Adam Reichold <adamreichold at myopera.com>
+// Copyright (C) 2014 Bogdan Cristea <cristeab at gmail.com>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -40,7 +41,7 @@
 // gDestroyMutex(&m);
 
 #ifdef _WIN32
-
+#define NOMINMAX
 #include <windows.h>
 
 typedef CRITICAL_SECTION GooMutex;
diff --git a/goo/GooTimer.h b/goo/GooTimer.h
index d77373e..7bbe9f0 100644
--- a/goo/GooTimer.h
+++ b/goo/GooTimer.h
@@ -8,6 +8,7 @@
 // Copyright 2007 Krzysztof Kowalczyk <kkowalczyk at gmail.com>
 // Copyright 2010 Hib Eris <hib at hiberis.nl>
 // Copyright 2011 Albert Astals cid <aacid at kde.org>
+// Copyright (C) 2014 Bogdan Cristea <cristeab at gmail.com>
 // Inspired by gtimer.c in glib, which is Copyright 2000 by the GLib Team
 //
 //========================================================================
@@ -26,6 +27,7 @@
 #endif
 
 #ifdef _WIN32
+#define NOMINMAX
 #include <windows.h>
 #endif
 
diff --git a/goo/gfile.h b/goo/gfile.h
index 5f546f1..264d7d9 100644
--- a/goo/gfile.h
+++ b/goo/gfile.h
@@ -20,6 +20,7 @@
 // Copyright (C) 2009 Kovid Goyal <kovid at kovidgoyal.net>
 // Copyright (C) 2013 Adam Reichold <adamreichold at myopera.com>
 // Copyright (C) 2013 Adrian Johnson <ajohnson at redneon.com>
+// Copyright (C) 2014 Bogdan Cristea <cristeab at gmail.com>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -39,6 +40,7 @@ extern "C" {
 #  ifdef FPTEX
 #    include <win32lib.h>
 #  else
+  #define NOMINMAX
 #    include <windows.h>
 #  endif
 #elif defined(ACORN)
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index c78d5ca..d7aae9f 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -30,6 +30,7 @@
 // Copyright (C) 2012, 2013 Fabio D'Urso <fabiodurso at hotmail.it>
 // Copyright (C) 2013 Adrian Johnson <ajohnson at redneon.com>
 // Copyright (C) 2013 Adam Reichold <adamreichold at myopera.com>
+// Copyright (C) 2014 Bogdan Cristea <cristeab at gmail.com>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -50,9 +51,6 @@
 #include <stddef.h>
 #include <string.h>
 #include <time.h>
-#ifdef _WIN32
-#  include <windows.h>
-#endif
 #include <sys/stat.h>
 #include "goo/gstrtod.h"
 #include "goo/GooString.h"
diff --git a/poppler/XpdfPluginAPI.h b/poppler/XpdfPluginAPI.h
index b0165c0..db90dba 100644
--- a/poppler/XpdfPluginAPI.h
+++ b/poppler/XpdfPluginAPI.h
@@ -12,6 +12,7 @@
 // under GPL version 2 or later
 //
 // Copyright (C) 2012 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2014 Bogdan Cristea <cristeab at gmail.com>
 //
 // To see a description of the changes please see the Changelog file that
 // came with your tarball or type make ChangeLog if you are building from git
@@ -22,6 +23,7 @@
 #define XPDFPLUGINAPI_H
 
 #ifdef _WIN32
+#define NOMINMAX
 #include <windows.h>
 #else
 #define Object XtObject
diff --git a/poppler/poppler-config.h.cmake b/poppler/poppler-config.h.cmake
index c4067c0..b04f2bf 100644
--- a/poppler/poppler-config.h.cmake
+++ b/poppler/poppler-config.h.cmake
@@ -6,6 +6,20 @@
 //
 //========================================================================
 
+//========================================================================
+//
+// Modified under the Poppler project - http://poppler.freedesktop.org
+//
+// All changes made under the Poppler project to this file are licensed
+// under GPL version 2 or later
+//
+// Copyright (C) 2014 Bogdan Cristea <cristeab at gmail.com>
+//
+// To see a description of the changes please see the Changelog file that
+// came with your tarball or type make ChangeLog if you are building from git
+//
+//========================================================================
+
 #ifndef POPPLER_CONFIG_H
 #define POPPLER_CONFIG_H
 
@@ -170,8 +184,8 @@ char * strtok_r (char *s, const char *delim, char **save_ptr);
 #endif
 
 #if defined(_MSC_VER)
-#define fmax(a, b) max(a, b)
-#define fmin(a, b) min(a, b)
+#define fmax(a, b) std::max(a, b)
+#define fmin(a, b) std::min(a, b)
 #endif
 
 
diff --git a/poppler/poppler-config.h.in b/poppler/poppler-config.h.in
index ada3434..8715406 100644
--- a/poppler/poppler-config.h.in
+++ b/poppler/poppler-config.h.in
@@ -6,6 +6,20 @@
 //
 //========================================================================
 
+//========================================================================
+//
+// Modified under the Poppler project - http://poppler.freedesktop.org
+//
+// All changes made under the Poppler project to this file are licensed
+// under GPL version 2 or later
+//
+// Copyright (C) 2014 Bogdan Cristea <cristeab at gmail.com>
+//
+// To see a description of the changes please see the Changelog file that
+// came with your tarball or type make ChangeLog if you are building from git
+//
+//========================================================================
+
 #ifndef POPPLER_CONFIG_H
 #define POPPLER_CONFIG_H
 
@@ -170,8 +184,8 @@ char * strtok_r (char *s, const char *delim, char **save_ptr);
 #endif
 
 #if defined(_MSC_VER)
-#define fmax(a, b) max(a, b)
-#define fmin(a, b) min(a, b)
+#define fmax(a, b) std::max(a, b)
+#define fmin(a, b) std::min(a, b)
 #endif
 
 
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 <unistd.h>
+#else
+#include <Windows.h>
+#define sleep Sleep
+#endif
 #include <time.h>
 
 #include <poppler-qt4.h>
diff --git a/qt5/src/poppler-private.h b/qt5/src/poppler-private.h
index 0a132f0..6eb9612 100644
--- a/qt5/src/poppler-private.h
+++ b/qt5/src/poppler-private.h
@@ -7,6 +7,7 @@
  * Copyright (C) 2011 Hib Eris <hib at hiberis.nl>
  * Copyright (C) 2012, 2013 Thomas Freitag <Thomas.Freitag at alfa.de>
  * Copyright (C) 2013 Anthony Granger <grangeranthony at gmail.com>
+ * Copyright (C) 2014 Bogdan Cristea <cristeab at gmail.com>
  * Inspired on code by
  * Copyright (C) 2004 by Albert Astals Cid <tsdgeos at terra.es>
  * Copyright (C) 2004 by Enrico Ros <eros.kde at email.it>
@@ -84,9 +85,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 <unistd.h>
+#else
+#include <Windows.h>
+#define sleep Sleep
+#endif
 #include <time.h>
 
 #include <poppler-qt5.h>
diff --git a/test/perf-test.cc b/test/perf-test.cc
index da14a7c..04adec3 100644
--- a/test/perf-test.cc
+++ b/test/perf-test.cc
@@ -469,7 +469,6 @@ struct FindFileState {
 };
 
 #ifdef _WIN32
-#include <windows.h>
 #include <sys/timeb.h>
 #include <direct.h>
 


More information about the poppler mailing list