mxe/src/poppler-1-win32.patch

140 lines
4.4 KiB
Diff
Raw Normal View History

This file is part of MXE. See LICENSE.md for licensing information.
2016-07-15 16:43:44 +01:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20L=C3=B6ffler?= <st.loeffler@gmail.com>
Date: Mon, 15 Sep 2014 19:53:04 -0700
Subject: [PATCH 1/2] Only check for Type1 fonts in custom directory if path is
non-NULL
Otherwise, programs using poppler may crash
Proposed upstream at https://bugs.freedesktop.org/show_bug.cgi?id=49037
diff --git a/poppler/GlobalParamsWin.cc b/poppler/GlobalParamsWin.cc
2016-07-15 16:43:44 +01:00
index 1111111..2222222 100644
--- a/poppler/GlobalParamsWin.cc
+++ b/poppler/GlobalParamsWin.cc
2013-11-28 01:10:44 +00:00
@@ -423,7 +423,7 @@ void GlobalParams::setupBaseFonts(char * dir)
2012-06-14 16:25:04 +01:00
if (fontFiles->lookup(fontName))
continue;
- if (dir) {
+ if (dir && displayFontTab[i].t1FileName) {
GooString *fontPath = appendToPath(new GooString(dir), displayFontTab[i].t1FileName);
2012-06-14 16:25:04 +01:00
if (FileExists(fontPath->getCString()) ||
FileExists(replaceSuffix(fontPath, ".pfb", ".pfa")->getCString())) {
2016-07-15 16:43:44 +01:00
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: darealshinji <djcj@gmx.de>
Date: Thu, 14 Jul 2016 13:21:26 +0200
Subject: [PATCH 2/2] enable cross-building DLLs
diff --git a/cpp/poppler-global.h b/cpp/poppler-global.h
2016-07-15 16:43:44 +01:00
index 1111111..2222222 100644
--- a/cpp/poppler-global.h
+++ b/cpp/poppler-global.h
2016-07-15 16:43:44 +01:00
@@ -21,7 +21,7 @@
#ifndef POPPLER_GLOBAL_H
#define POPPLER_GLOBAL_H
-#if defined(_WIN32)
2016-07-15 16:43:44 +01:00
+#if defined(_WIN32) && defined(DLL_EXPORT)
# define LIB_EXPORT __declspec(dllexport)
# define LIB_IMPORT __declspec(dllimport)
#else
diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
index 1111111..2222222 100644
--- a/poppler/GlobalParams.cc
+++ b/poppler/GlobalParams.cc
@@ -150,6 +150,7 @@ PSFontParam16::~PSFontParam16() {
2016-07-15 16:43:44 +01:00
static HMODULE hmodule;
+#ifdef DLL_EXPORT
extern "C" {
BOOL WINAPI
DllMain (HINSTANCE hinstDLL,
@@ -166,6 +167,7 @@ DllMain (HINSTANCE hinstDLL,
return TRUE;
}
}
+#endif
static const char *
get_poppler_datadir (void)
diff --git a/poppler/XpdfPluginAPI.h b/poppler/XpdfPluginAPI.h
2016-07-15 16:43:44 +01:00
index 1111111..2222222 100644
--- a/poppler/XpdfPluginAPI.h
+++ b/poppler/XpdfPluginAPI.h
2016-07-15 16:43:44 +01:00
@@ -47,7 +47,7 @@ extern "C" {
*/
#define xpdfPluginAPIVersion 1
-#ifdef _WIN32
2016-07-15 16:43:44 +01:00
+#if defined(_WIN32) && defined(DLL_EXPORT)
# ifdef __cplusplus
2016-07-15 16:43:44 +01:00
# define PLUGINFUNC(retType) extern "C" __declspec(dllexport) retType
# else
2016-07-15 16:43:44 +01:00
@@ -286,7 +286,7 @@ void (*_xpdfRegisterSecurityHandler)(XpdfSecurityHandler *handler);
} XpdfPluginVecTable;
-#ifdef _WIN32
2016-07-15 16:43:44 +01:00
+#if defined(_WIN32) && defined(DLL_EXPORT)
2016-07-15 16:43:44 +01:00
extern __declspec(dllexport) XpdfPluginVecTable xpdfPluginVecTable;
diff --git a/qt4/src/poppler-export.h b/qt4/src/poppler-export.h
2016-07-15 16:43:44 +01:00
index 1111111..2222222 100644
--- a/qt4/src/poppler-export.h
+++ b/qt4/src/poppler-export.h
2016-07-15 16:43:44 +01:00
@@ -2,7 +2,7 @@
* This file is used to set the poppler_qt4_EXPORT macros right.
* This is needed for setting the visibility on windows, it will have no effect on other platforms.
*/
-#if defined(_WIN32)
2016-07-15 16:43:44 +01:00
+#if defined(_WIN32) && defined(DLL_EXPORT)
# define _POPPLER_QT4_LIB_EXPORT __declspec(dllexport)
# define _POPPLER_QT4_LIB_IMPORT __declspec(dllimport)
#elif defined(__GNUC__)
2016-12-27 00:58:03 +00:00
diff --git a/qt5/src/poppler-export.h b/qt5/src/poppler-export.h
index 1111111..2222222 100644
--- a/qt5/src/poppler-export.h
+++ b/qt5/src/poppler-export.h
@@ -2,7 +2,7 @@
* This file is used to set the poppler_qt4_EXPORT macros right.
* This is needed for setting the visibility on windows, it will have no effect on other platforms.
*/
-#if defined(_WIN32)
+#if defined(_WIN32) && defined(DLL_EXPORT)
# define _POPPLER_QT5_LIB_EXPORT __declspec(dllexport)
# define _POPPLER_QT5_LIB_IMPORT __declspec(dllimport)
#elif defined(__GNUC__)
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Boris Nagaev <bnagaev@gmail.com>
Date: Wed, 27 Jul 2016 10:29:52 +0200
Subject: [PATCH] do not try to use mman.h (package mman-win32)
fix https://github.com/mxe/mxe/issues/1455
diff --git a/poppler/CairoFontEngine.cc b/poppler/CairoFontEngine.cc
index 1111111..2222222 100644
--- a/poppler/CairoFontEngine.cc
+++ b/poppler/CairoFontEngine.cc
@@ -48,13 +48,6 @@
#include "Gfx.h"
#include "Page.h"
-#if HAVE_FCNTL_H && HAVE_SYS_MMAN_H && HAVE_SYS_STAT_H
-#include <fcntl.h>
-#include <sys/stat.h>
-#include <sys/mman.h>
-#define CAN_CHECK_OPEN_FACES 1
-#endif
-
#ifdef USE_GCC_PRAGMAS
#pragma implementation
#endif