view src/poppler-1-win32.patch @ 5893:53a6c7df43f8

Mesa 3D: Update to version 21.1.8. * src/mesa.mk: Update version and checksum. * src/mesa-2-uninitialized.patch: Remove file. * dist-files.mk: Remove file from list.
author Markus Mützel <markus.muetzel@gmx.de>
date Thu, 16 Sep 2021 22:37:45 +0200
parents 9aa687683a32
children
line wrap: on
line source

This file is part of MXE.
See index.html for further information.

From 0cdf3c0c6d2740fa3542d7030878eaffdd4cf7a4 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20L=C3=B6ffler?= <st.loeffler@gmail.com>
Date: Sat, 21 Apr 2012 09:34:46 +0200
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
index 527f08e..0739946 100644
--- a/poppler/GlobalParamsWin.cc
+++ b/poppler/GlobalParamsWin.cc
@@ -424,7 +424,7 @@ void GlobalParams::setupBaseFonts(char * dir)
         if (fontFiles->lookup(fontName))
             continue;
 
-        if (dir) {
+        if (dir && displayFontTab[i].t1FileName) {
             GooString *fontPath = appendToPath(new GooString(dir), displayFontTab[i].t1FileName);
             if (FileExists(fontPath->getCString()) ||
                 FileExists(replaceSuffix(fontPath, ".pfb", ".pfa")->getCString())) {
-- 
1.7.10.4


From fe1720718e224b0138f3f95c5aa0c72ac85e06b8 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Stefan=20L=C3=B6ffler?= <st.loeffler@gmail.com>
Date: Sat, 21 Apr 2012 13:19:54 +0200
Subject: [PATCH 2/2] Don't use dllimport/dllexport

Otherwise static linking fails
MXE workaround for https://bugs.freedesktop.org/show_bug.cgi?id=49038 (presumably would break shared linking!)

diff --git a/cpp/poppler-global.h b/cpp/poppler-global.h
index 5650182..6c3e01b 100644
--- a/cpp/poppler-global.h
+++ b/cpp/poppler-global.h
@@ -20,13 +20,8 @@
 #ifndef POPPLER_GLOBAL_H
 #define POPPLER_GLOBAL_H
 
-#if defined(_WIN32)
-#  define LIB_EXPORT __declspec(dllexport)
-#  define LIB_IMPORT __declspec(dllimport)
-#else
 #  define LIB_EXPORT
 #  define LIB_IMPORT
-#endif
 
 #if defined(poppler_cpp_EXPORTS)
 #  define POPPLER_CPP_EXPORT LIB_EXPORT
diff --git a/poppler/XpdfPluginAPI.h b/poppler/XpdfPluginAPI.h
index b0165c0..5a10595 100644
--- a/poppler/XpdfPluginAPI.h
+++ b/poppler/XpdfPluginAPI.h
@@ -42,19 +42,11 @@ extern "C" {
  */
 #define xpdfPluginAPIVersion 1
 
-#ifdef _WIN32
-#  ifdef __cplusplus
-#    define PLUGINFUNC(retType) extern "C" __declspec(dllexport) retType
-#  else
-#    define PLUGINFUNC(retType) extern __declspec(dllexport) retType
-#  endif
-#else
 #  ifdef __cplusplus
 #    define PLUGINFUNC(retType) extern "C" retType
 #  else
 #    define PLUGINFUNC(retType) extern retType
 #  endif
-#endif
 
 /*------------------------------------------------------------------------
  * Plugin setup/cleanup
@@ -281,22 +273,12 @@ void (*_xpdfRegisterSecurityHandler)(XpdfSecurityHandler *handler);
 
 } XpdfPluginVecTable;
 
-#ifdef _WIN32
-
-extern __declspec(dllexport) XpdfPluginVecTable xpdfPluginVecTable;
-
-#define xpdfPluginSetup \
-  extern __declspec(dllexport) \
-  XpdfPluginVecTable xpdfPluginVecTable = {xpdfPluginAPIVersion};
-
-#else
 
 extern XpdfPluginVecTable xpdfPluginVecTable;
 
 #define xpdfPluginSetup \
   XpdfPluginVecTable xpdfPluginVecTable = {xpdfPluginAPIVersion};
 
-#endif
 
 #define xpdfGetInfoDict (*xpdfPluginVecTable._xpdfGetInfoDict)
 #define xpdfGetCatalog (*xpdfPluginVecTable._xpdfGetCatalog)
diff --git a/qt4/src/poppler-export.h b/qt4/src/poppler-export.h
index 7661fe9..ebb1e18 100644
--- a/qt4/src/poppler-export.h
+++ b/qt4/src/poppler-export.h
@@ -2,13 +2,8 @@
 * 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)
-# define LIB_EXPORT __declspec(dllexport)
-# define LIB_IMPORT __declspec(dllimport)
-#else
 # define LIB_EXPORT
 # define LIB_IMPORT
-#endif
 
 #ifdef poppler_qt4_EXPORTS
 # define POPPLER_QT4_EXPORT LIB_EXPORT
-- 
1.7.10.4