Commit 31edf585 authored by Bogdan Cristea's avatar Bogdan Cristea Committed by Albert Astals Cid

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

Bug #73111
parent 834cd18e
......@@ -19,6 +19,7 @@
// Copyright (C) 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
// Copyright (C) 2013 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2013 Adam Reichold <adamreichold@myopera.com>
// Copyright (C) 2014 Bogdan Cristea <cristeab@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;
......
......@@ -8,6 +8,7 @@
// Copyright 2007 Krzysztof Kowalczyk <kkowalczyk@gmail.com>
// Copyright 2010 Hib Eris <hib@hiberis.nl>
// Copyright 2011 Albert Astals cid <aacid@kde.org>
// Copyright (C) 2014 Bogdan Cristea <cristeab@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
......
......@@ -20,6 +20,7 @@
// Copyright (C) 2009 Kovid Goyal <kovid@kovidgoyal.net>
// Copyright (C) 2013 Adam Reichold <adamreichold@myopera.com>
// Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com>
// Copyright (C) 2014 Bogdan Cristea <cristeab@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)
......
......@@ -30,6 +30,7 @@
// Copyright (C) 2012, 2013 Fabio D'Urso <fabiodurso@hotmail.it>
// Copyright (C) 2013 Adrian Johnson <ajohnson@redneon.com>
// Copyright (C) 2013 Adam Reichold <adamreichold@myopera.com>
// Copyright (C) 2014 Bogdan Cristea <cristeab@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"
......
......@@ -12,6 +12,7 @@
// under GPL version 2 or later
//
// Copyright (C) 2012 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2014 Bogdan Cristea <cristeab@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
......
......@@ -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@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
......
......@@ -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@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
......
#ifndef _WIN32
#include <unistd.h>
#else
#include <Windows.h>
#define sleep Sleep
#endif
#include <time.h>
#include <poppler-qt4.h>
......
......@@ -7,6 +7,7 @@
* Copyright (C) 2011 Hib Eris <hib@hiberis.nl>
* Copyright (C) 2012, 2013 Thomas Freitag <Thomas.Freitag@alfa.de>
* Copyright (C) 2013 Anthony Granger <grangeranthony@gmail.com>
* Copyright (C) 2014 Bogdan Cristea <cristeab@gmail.com>
* Inspired on code by
* Copyright (C) 2004 by Albert Astals Cid <tsdgeos@terra.es>
* Copyright (C) 2004 by Enrico Ros <eros.kde@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
......
#ifndef _WIN32
#include <unistd.h>
#else
#include <Windows.h>
#define sleep Sleep
#endif
#include <time.h>
#include <poppler-qt5.h>
......
......@@ -469,7 +469,6 @@ struct FindFileState {
};
#ifdef _WIN32
#include <windows.h>
#include <sys/timeb.h>
#include <direct.h>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment