texlive[48812] Build/source/libs/xpdf: xpdf: modified for w32 (w32

commits+kakuto at tug.org commits+kakuto at tug.org
Tue Oct 2 17:39:11 CEST 2018


Revision: 48812
          http://tug.org/svn/texlive?view=revision&revision=48812
Author:   kakuto
Date:     2018-10-02 17:39:11 +0200 (Tue, 02 Oct 2018)
Log Message:
-----------
xpdf: modified for w32 (w32 only)

Modified Paths:
--------------
    trunk/Build/source/libs/xpdf/ChangeLog
    trunk/Build/source/libs/xpdf/TLpatches/ChangeLog
    trunk/Build/source/libs/xpdf/TLpatches/patch-bunched
    trunk/Build/source/libs/xpdf/xpdf-src/goo/gfile.cc
    trunk/Build/source/libs/xpdf/xpdf-src/xpdf/PDFDoc.cc

Added Paths:
-----------
    trunk/Build/source/libs/xpdf/aconf-w32.h

Modified: trunk/Build/source/libs/xpdf/ChangeLog
===================================================================
--- trunk/Build/source/libs/xpdf/ChangeLog	2018-10-02 14:33:09 UTC (rev 48811)
+++ trunk/Build/source/libs/xpdf/ChangeLog	2018-10-02 15:39:11 UTC (rev 48812)
@@ -1,3 +1,7 @@
+2018-10-02  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* aconf-w32.h: Added for w32.
+
 2017-08-13  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	* Import xpdf-4.00.

Modified: trunk/Build/source/libs/xpdf/TLpatches/ChangeLog
===================================================================
--- trunk/Build/source/libs/xpdf/TLpatches/ChangeLog	2018-10-02 14:33:09 UTC (rev 48811)
+++ trunk/Build/source/libs/xpdf/TLpatches/ChangeLog	2018-10-02 15:39:11 UTC (rev 48812)
@@ -1,3 +1,7 @@
+2018-10-02  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
+
+	* patch-bunched: Changed for w32.
+
 2017-08-13  Akira Kakuto  <kakuto at fuk.kindai.ac.jp>
 
 	Imported xpdf-4.00 source tree:

Modified: trunk/Build/source/libs/xpdf/TLpatches/patch-bunched
===================================================================
--- trunk/Build/source/libs/xpdf/TLpatches/patch-bunched	2018-10-02 14:33:09 UTC (rev 48811)
+++ trunk/Build/source/libs/xpdf/TLpatches/patch-bunched	2018-10-02 15:39:11 UTC (rev 48812)
@@ -1,6 +1,6 @@
-diff -ur xpdf-4.00.orig/goo/gfile.cc xpdf-4.00/goo/gfile.cc
---- xpdf-4.00.orig/goo/gfile.cc	Wed Aug 09 08:22:50 2017
-+++ xpdf-4.00/goo/gfile.cc	Sun Aug 13 13:46:03 2017
+diff -ur xpdf-4.00/goo/gfile.cc xpdf-src/goo/gfile.cc
+--- xpdf-4.00/goo/gfile.cc	Wed Aug 09 08:22:50 2017
++++ xpdf-src/goo/gfile.cc	Tue Oct 02 19:53:38 2018
 @@ -7,6 +7,9 @@
  // Copyright 1996-2003 Glyph & Cog, LLC
  //
@@ -44,9 +44,26 @@
  #else
    return !mkdir(path, mode);
  #endif
-diff -ur xpdf-4.00.orig/xpdf/GlobalParams.cc xpdf-4.00/xpdf/GlobalParams.cc
---- xpdf-4.00.orig/xpdf/GlobalParams.cc	Wed Aug 09 08:22:50 2017
-+++ xpdf-4.00/xpdf/GlobalParams.cc	Sun Aug 13 13:51:37 2017
+@@ -571,6 +580,8 @@
+ 
+ FILE *openFile(const char *path, const char *mode) {
+ #ifdef _WIN32
++  return fopen(path, mode);
++#if 0
+   OSVERSIONINFO version;
+   wchar_t wPath[_MAX_PATH + 1];
+   char nPath[_MAX_PATH + 1];
+@@ -627,6 +638,7 @@
+     nPath[i] = '\0';
+     return fopen(nPath, mode);
+   }
++#endif /* 0 */
+ #else
+   return fopen(path, mode);
+ #endif
+diff -ur xpdf-4.00/xpdf/GlobalParams.cc xpdf-src/xpdf/GlobalParams.cc
+--- xpdf-4.00/xpdf/GlobalParams.cc	Wed Aug 09 08:22:50 2017
++++ xpdf-src/xpdf/GlobalParams.cc	Sun Aug 13 13:51:38 2017
 @@ -5,6 +5,9 @@
  // Copyright 2001-2003 Glyph & Cog, LLC
  //
@@ -100,31 +117,54 @@
        }
      }
    }
-diff -ur xpdf-4.00.orig/xpdf/GlobalParams.h xpdf-4.00/xpdf/GlobalParams.h
---- xpdf-4.00.orig/xpdf/GlobalParams.h	Wed Aug 09 08:22:50 2017
-+++ xpdf-4.00/xpdf/GlobalParams.h	Sun Aug 13 13:32:19 2017
-@@ -5,6 +5,9 @@
- // Copyright 2001-2003 Glyph & Cog, LLC
- //
- //========================================================================
-+//  Modified for TeX Live by Peter Breitenlohner <tex-live at tug.org>
-+//  See top-level ChangeLog for a list of all modifications
-+//========================================================================
+diff -ur xpdf-4.00/xpdf/PDFDoc.cc xpdf-src/xpdf/PDFDoc.cc
+--- xpdf-4.00/xpdf/PDFDoc.cc	Wed Aug 09 08:22:50 2017
++++ xpdf-src/xpdf/PDFDoc.cc	Tue Oct 02 19:57:40 2018
+@@ -147,13 +147,17 @@
  
- #ifndef GLOBALPARAMS_H
- #define GLOBALPARAMS_H
-@@ -217,7 +220,7 @@
+   // try to open file
+   // NB: _wfopen is only available in NT
++/*
+   version.dwOSVersionInfoSize = sizeof(version);
+   GetVersionEx(&version);
+   if (version.dwPlatformId == VER_PLATFORM_WIN32_NT) {
+     file = _wfopen(fileNameU, L"rb");
+   } else {
++*/
+     file = fopen(fileName->getCString(), "rb");
++/*
+   }
++*/
+   if (!file) {
+     error(errIO, -1, "Couldn't open file '{0:t}'", fileName);
+     errCode = errOpenFile;
+@@ -535,6 +539,7 @@
+   GBool ret;
  
-   // Initialize the global parameters by attempting to read a config
-   // file.
--  GlobalParams(const char *cfgFileName);
-+  GlobalParams(const char *cfgFileName = NULL);
- 
-   ~GlobalParams();
- 
-diff -ur xpdf-4.00.orig/xpdf/Page.cc xpdf-4.00/xpdf/Page.cc
---- xpdf-4.00.orig/xpdf/Page.cc	Wed Aug 09 08:22:50 2017
-+++ xpdf-4.00/xpdf/Page.cc	Sun Aug 13 13:24:07 2017
+   // NB: _wfopen is only available in NT
++/*
+   version.dwOSVersionInfoSize = sizeof(version);
+   GetVersionEx(&version);
+   if (version.dwPlatformId == VER_PLATFORM_WIN32_NT) {
+@@ -544,12 +549,15 @@
+     path2w[i] = 0;
+     f = _wfopen(path2w, L"wb");
+   } else {
++*/
+     for (i = 0; i < pathLen && i < _MAX_PATH; ++i) {
+       path2c[i] = (char)path[i];
+     }
+     path2c[i] = 0;
+     f = fopen(path2c, "wb");
++/*
+   }
++*/
+   if (!f) {
+     return gFalse;
+   }
+diff -ur xpdf-4.00/xpdf/Page.cc xpdf-src/xpdf/Page.cc
+--- xpdf-4.00/xpdf/Page.cc	Wed Aug 09 08:22:50 2017
++++ xpdf-src/xpdf/Page.cc	Sun Aug 13 13:24:08 2017
 @@ -480,9 +480,9 @@
    delete links;
  }
@@ -143,9 +183,9 @@
 -}
  #endif
 +}
-diff -ur xpdf-4.00.orig/xpdf/XFAForm.cc xpdf-4.00/xpdf/XFAForm.cc
---- xpdf-4.00.orig/xpdf/XFAForm.cc	Wed Aug 09 08:22:50 2017
-+++ xpdf-4.00/xpdf/XFAForm.cc	Sun Aug 13 14:28:34 2017
+diff -ur xpdf-4.00/xpdf/XFAForm.cc xpdf-src/xpdf/XFAForm.cc
+--- xpdf-4.00/xpdf/XFAForm.cc	Wed Aug 09 08:22:50 2017
++++ xpdf-src/xpdf/XFAForm.cc	Sun Aug 13 14:28:34 2017
 @@ -27,8 +27,10 @@
  #include "XFAForm.h"
  
@@ -159,18 +199,3 @@
  #endif
  
  //------------------------------------------------------------------------
-diff -ur xpdf-4.00.orig/xpdf/config.h xpdf-4.00/xpdf/config.h
---- xpdf-4.00.orig/xpdf/config.h	Wed Aug 09 08:22:50 2017
-+++ xpdf-4.00/xpdf/config.h	Sun Aug 13 13:42:04 2017
-@@ -78,11 +78,6 @@
- // popen
- //------------------------------------------------------------------------
- 
--#if defined(_MSC_VER) || defined(__BORLANDC__)
--#define popen _popen
--#define pclose _pclose
--#endif
--
- #if defined(VMS) || defined(VMCMS) || defined(DOS) || defined(OS2) || defined(__EMX__) || defined(_WIN32) || defined(__DJGPP__)
- #define POPEN_READ_MODE "rb"
- #else

Added: trunk/Build/source/libs/xpdf/aconf-w32.h
===================================================================
--- trunk/Build/source/libs/xpdf/aconf-w32.h	                        (rev 0)
+++ trunk/Build/source/libs/xpdf/aconf-w32.h	2018-10-02 15:39:11 UTC (rev 48812)
@@ -0,0 +1,142 @@
+/*
+ * aconf-w32.h
+ *
+ * Copyright 2002-2003 Glyph & Cog, LLC
+ * Copyright 2018 A. Kakuto
+ */
+
+#ifndef ACONF_H
+#define ACONF_H
+
+#include <aconf2.h>
+
+/*
+ * Use A4 paper size instead of Letter for PostScript output.
+ */
+#define A4_PAPER 1
+
+/*
+ * Do not allow text selection.
+ */
+#undef NO_TEXT_SELECT
+
+/*
+ * Include support for OPI comments.
+ */
+#undef OPI_SUPPORT
+
+/*
+ * Enable multithreading support.
+ */
+#define MULTITHREADED 1
+
+/*
+ * Enable C++ exceptions.
+ */
+#define USE_EXCEPTIONS 1
+
+/*
+ * Use fixed point (instead of floating point) arithmetic.
+ */
+#undef USE_FIXEDPOINT
+
+/*
+ * Directory with the Xpdf app-defaults file.
+ */
+#undef APPDEFDIR
+
+/*
+ * Full path for the system-wide xpdfrc file.
+ */
+#undef SYSTEM_XPDFRC
+
+/*
+ * Various include files and functions.
+ */
+#undef HAVE_DIRENT_H
+#undef HAVE_SYS_NDIR_H
+#undef HAVE_SYS_DIR_H
+#undef HAVE_NDIR_H
+#undef HAVE_SYS_SELECT_H
+#undef HAVE_SYS_BSDTYPES_H
+#undef HAVE_STRINGS_H
+#undef HAVE_BSTRING_H
+#define HAVE_POPEN 1
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+#include <kpathsea/config.h>
+#ifdef __cplusplus
+}
+#endif
+
+#undef index
+
+#undef HAVE_MKSTEMP
+#undef HAVE_MKSTEMPS
+#undef SELECT_TAKES_INT
+#define HAVE_STD_SORT 1
+#undef HAVE_FSEEKO
+#undef HAVE_FSEEK64
+#define HAVE_FSEEKI64 1
+#undef _FILE_OFFSET_BITS
+#undef _LARGE_FILES
+#undef _LARGEFILE_SOURCE
+#undef HAVE_XTAPPSETEXITFLAG
+
+/*
+ * This is defined if using libXpm.
+ */
+#undef HAVE_X11_XPM_H
+
+/*
+ * One of these is defined if using FreeType (version 1 or 2).
+ */
+#undef HAVE_FREETYPE_H
+#define HAVE_FREETYPE_FREETYPE_H 1
+
+/*
+ * This is defined if using FreeType version 2.
+ */
+#define FREETYPE2 1
+
+/*
+ * This is defined if using libpaper.
+ */
+#undef HAVE_PAPER_H
+
+/*
+ * Enable support for loading plugins.
+ */
+#undef ENABLE_PLUGINS
+
+/*
+ * Defined if the Splash library is avaiable.
+ */
+#define HAVE_SPLASH 1
+
+/*
+ * Enable support for CMYK output.
+ */
+#define SPLASH_CMYK 1
+
+#ifdef _WIN32
+#ifdef LINKDLL
+#define XPDFDLL __declspec(dllimport)
+#else
+#define XPDFDLL extern
+#endif
+#ifdef __cplusplus
+extern "C" {
+#endif
+XPDFDLL
+FILE *fsyscp_fopen (const char *filename, const char *mode);
+#ifdef __cplusplus
+}
+#endif
+#undef fopen
+#define fopen fsyscp_fopen
+#endif /* _WIN32 */
+
+#endif


Property changes on: trunk/Build/source/libs/xpdf/aconf-w32.h
___________________________________________________________________
Added: svn:eol-style
## -0,0 +1 ##
+LF
\ No newline at end of property
Modified: trunk/Build/source/libs/xpdf/xpdf-src/goo/gfile.cc
===================================================================
--- trunk/Build/source/libs/xpdf/xpdf-src/goo/gfile.cc	2018-10-02 14:33:09 UTC (rev 48811)
+++ trunk/Build/source/libs/xpdf/xpdf-src/goo/gfile.cc	2018-10-02 15:39:11 UTC (rev 48812)
@@ -580,6 +580,8 @@
 
 FILE *openFile(const char *path, const char *mode) {
 #ifdef _WIN32
+  return fopen(path, mode);
+#if 0
   OSVERSIONINFO version;
   wchar_t wPath[_MAX_PATH + 1];
   char nPath[_MAX_PATH + 1];
@@ -636,6 +638,7 @@
     nPath[i] = '\0';
     return fopen(nPath, mode);
   }
+#endif /* 0 */
 #else
   return fopen(path, mode);
 #endif

Modified: trunk/Build/source/libs/xpdf/xpdf-src/xpdf/PDFDoc.cc
===================================================================
--- trunk/Build/source/libs/xpdf/xpdf-src/xpdf/PDFDoc.cc	2018-10-02 14:33:09 UTC (rev 48811)
+++ trunk/Build/source/libs/xpdf/xpdf-src/xpdf/PDFDoc.cc	2018-10-02 15:39:11 UTC (rev 48812)
@@ -147,13 +147,17 @@
 
   // try to open file
   // NB: _wfopen is only available in NT
+/*
   version.dwOSVersionInfoSize = sizeof(version);
   GetVersionEx(&version);
   if (version.dwPlatformId == VER_PLATFORM_WIN32_NT) {
     file = _wfopen(fileNameU, L"rb");
   } else {
+*/
     file = fopen(fileName->getCString(), "rb");
+/*
   }
+*/
   if (!file) {
     error(errIO, -1, "Couldn't open file '{0:t}'", fileName);
     errCode = errOpenFile;
@@ -535,6 +539,7 @@
   GBool ret;
 
   // NB: _wfopen is only available in NT
+/*
   version.dwOSVersionInfoSize = sizeof(version);
   GetVersionEx(&version);
   if (version.dwPlatformId == VER_PLATFORM_WIN32_NT) {
@@ -544,12 +549,15 @@
     path2w[i] = 0;
     f = _wfopen(path2w, L"wb");
   } else {
+*/
     for (i = 0; i < pathLen && i < _MAX_PATH; ++i) {
       path2c[i] = (char)path[i];
     }
     path2c[i] = 0;
     f = fopen(path2c, "wb");
+/*
   }
+*/
   if (!f) {
     return gFalse;
   }



More information about the tex-live-commits mailing list