summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Garcia Campos <carlosgc@gnome.org>2014-06-06 20:28:37 +0200
committerCarlos Garcia Campos <carlosgc@gnome.org>2014-06-06 20:28:37 +0200
commit07f95487b11c165fcb150a5e09213ff32a8309e5 (patch)
tree0d10b7b2a4aeb2b32d5fe3ecf4a93e91b3b209ca
parent8fe6c0b2322ecc45844383bf5dee100f4cd310b7 (diff)
Use the correct _WIN32 define instead of WIN32
-rw-r--r--ALL_DIFF663
-rw-r--r--CHANGES-3.041
2 files changed, 17 insertions, 647 deletions
diff --git a/ALL_DIFF b/ALL_DIFF
index ec34609..d95077a 100644
--- a/ALL_DIFF
+++ b/ALL_DIFF
@@ -1,18 +1,3 @@
-diff -uNrp xpdf-3.03/aconf2.h xpdf-3.04/aconf2.h
---- xpdf-3.03/aconf2.h 2011-08-15 23:08:53.000000000 +0200
-+++ xpdf-3.04/aconf2.h 2014-05-28 20:50:50.000000000 +0200
-@@ -28,11 +28,4 @@
- # endif
- #endif
-
--/*
-- * Make sure WIN32 is defined if appropriate.
-- */
--#if defined(_WIN32) && !defined(WIN32)
--# define WIN32
--#endif
--
- #endif
diff -uNrp xpdf-3.03/aconf-dj.h xpdf-3.04/aconf-dj.h
--- xpdf-3.03/aconf-dj.h 2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.04/aconf-dj.h 2014-05-28 20:50:50.000000000 +0200
@@ -5965,55 +5950,6 @@ diff -uNrp xpdf-3.03/fofi/Makefile.in xpdf-3.04/fofi/Makefile.in
diff -uNrp xpdf-3.03/goo/gfile.cc xpdf-3.04/goo/gfile.cc
--- xpdf-3.03/goo/gfile.cc 2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.04/goo/gfile.cc 2014-05-28 20:50:50.000000000 +0200
-@@ -10,8 +10,9 @@
-
- #include <aconf.h>
-
--#ifdef WIN32
-+#ifdef _WIN32
- # include <time.h>
-+# include <direct.h>
- #else
- # if defined(MACOS)
- # include <sys/stat.h>
-@@ -29,7 +30,7 @@
- # if defined(VMS) && (__DECCXX_VER < 50200000)
- # include <unixlib.h>
- # endif
--#endif // WIN32
-+#endif // _WIN32
- #include "GString.h"
- #include "gfile.h"
-
-@@ -46,7 +47,7 @@ GString *getHomeDir() {
- //---------- VMS ----------
- return new GString("SYS$LOGIN:");
-
--#elif defined(__EMX__) || defined(WIN32)
-+#elif defined(__EMX__) || defined(_WIN32)
- //---------- OS/2+EMX and Win32 ----------
- char *s;
- GString *ret;
-@@ -92,8 +93,8 @@ GString *getCurrentDir() {
-
- #if defined(__EMX__)
- if (_getcwd2(buf, sizeof(buf)))
--#elif defined(WIN32)
-- if (GetCurrentDirectory(sizeof(buf), buf))
-+#elif defined(_WIN32)
-+ if (GetCurrentDirectoryA(sizeof(buf), buf))
- #elif defined(ACORN)
- if (strcpy(buf, "@"))
- #elif defined(MACOS)
-@@ -146,7 +147,7 @@ GString *appendToPath(GString *path, con
- }
- return path;
-
--#elif defined(WIN32)
-+#elif defined(_WIN32)
- //---------- Win32 ----------
- GString *tmp;
- char buf[256];
@@ -155,7 +156,7 @@ GString *appendToPath(GString *path, con
tmp = new GString(path);
tmp->append('/');
@@ -6023,61 +5959,6 @@ diff -uNrp xpdf-3.03/goo/gfile.cc xpdf-3.04/goo/gfile.cc
delete tmp;
path->clear();
path->append(buf);
-@@ -282,7 +283,7 @@ GString *grabPath(char *fileName) {
- return new GString(fileName, p + 1 - fileName);
- return new GString();
-
--#elif defined(__EMX__) || defined(WIN32)
-+#elif defined(__EMX__) || defined(_WIN32)
- //---------- OS/2+EMX and Win32 ----------
- char *p;
-
-@@ -326,7 +327,7 @@ GBool isAbsolutePath(char *path) {
- return strchr(path, ':') ||
- (path[0] == '[' && path[1] != '.' && path[1] != '-');
-
--#elif defined(__EMX__) || defined(WIN32)
-+#elif defined(__EMX__) || defined(_WIN32)
- //---------- OS/2+EMX and Win32 ----------
- return path[0] == '/' || path[0] == '\\' || path[1] == ':';
-
-@@ -356,13 +357,13 @@ GString *makePathAbsolute(GString *path)
- }
- return path;
-
--#elif defined(WIN32)
-+#elif defined(_WIN32)
- //---------- Win32 ----------
- char buf[_MAX_PATH];
- char *fp;
-
- buf[0] = '\0';
-- if (!GetFullPathName(path->getCString(), _MAX_PATH, buf, &fp)) {
-+ if (!GetFullPathNameA(path->getCString(), _MAX_PATH, buf, &fp)) {
- path->clear();
- return path;
- }
-@@ -427,7 +428,7 @@ GString *makePathAbsolute(GString *path)
- }
-
- time_t getModTime(char *fileName) {
--#ifdef WIN32
-+#ifdef _WIN32
- //~ should implement this, but it's (currently) only used in xpdf
- return 0;
- #else
-@@ -440,8 +441,9 @@ time_t getModTime(char *fileName) {
- #endif
- }
-
--GBool openTempFile(GString **name, FILE **f, const char *mode, char *ext) {
--#if defined(WIN32)
-+GBool openTempFile(GString **name, FILE **f,
-+ const char *mode, const char *ext) {
-+#if defined(_WIN32)
- //---------- Win32 ----------
- char *tempDir;
- GString *s, *s2;
@@ -550,6 +552,14 @@ GBool openTempFile(GString **name, FILE
#endif
}
@@ -6093,24 +5974,6 @@ diff -uNrp xpdf-3.03/goo/gfile.cc xpdf-3.04/goo/gfile.cc
GBool executeCommand(char *cmd) {
#ifdef VMS
return system(cmd) ? gTrue : gFalse;
-@@ -558,7 +568,7 @@ GBool executeCommand(char *cmd) {
- #endif
- }
-
--#ifdef WIN32
-+#ifdef _WIN32
- GString *fileNameToUTF8(char *path) {
- GString *s;
- char *p;
-@@ -597,7 +607,7 @@ GString *fileNameToUTF8(wchar_t *path) {
- #endif
-
- FILE *openFile(const char *path, const char *mode) {
--#ifdef WIN32
-+#ifdef _WIN32
- OSVERSIONINFO version;
- wchar_t wPath[_MAX_PATH + 1];
- char nPath[_MAX_PATH + 1];
@@ -688,6 +698,30 @@ char *getLine(char *buf, int size, FILE
return buf;
}
@@ -6142,32 +6005,18 @@ diff -uNrp xpdf-3.03/goo/gfile.cc xpdf-3.04/goo/gfile.cc
//------------------------------------------------------------------------
// GDir and GDirEntry
//------------------------------------------------------------------------
-@@ -695,7 +729,7 @@ char *getLine(char *buf, int size, FILE
- GDirEntry::GDirEntry(char *dirPath, char *nameA, GBool doStat) {
- #ifdef VMS
- char *p;
--#elif defined(WIN32)
-+#elif defined(_WIN32)
- int fa;
- GString *s;
- #elif defined(ACORN)
@@ -715,8 +749,8 @@ GDirEntry::GDirEntry(char *dirPath, char
#else
s = new GString(dirPath);
appendToPath(s, nameA);
--#ifdef WIN32
+#ifdef _WIN32
- fa = GetFileAttributes(s->getCString());
-+#ifdef _WIN32
+ fa = GetFileAttributesA(s->getCString());
dir = (fa != 0xFFFFFFFF && (fa & FILE_ATTRIBUTE_DIRECTORY));
#else
if (stat(s->getCString(), &st) == 0)
@@ -734,15 +768,16 @@ GDirEntry::~GDirEntry() {
- GDir::GDir(char *name, GBool doStatA) {
- path = new GString(name);
- doStat = doStatA;
--#if defined(WIN32)
-+#if defined(_WIN32)
+#if defined(_WIN32)
GString *tmp;
tmp = path->copy();
@@ -6182,11 +6031,6 @@ diff -uNrp xpdf-3.03/goo/gfile.cc xpdf-3.04/goo/gfile.cc
dir = opendir(name);
#ifdef VMS
@@ -753,13 +788,14 @@ GDir::GDir(char *name, GBool doStatA) {
-
- GDir::~GDir() {
- delete path;
--#if defined(WIN32)
-+#if defined(_WIN32)
if (hnd) {
FindClose(hnd);
hnd = NULL;
@@ -6198,11 +6042,7 @@ diff -uNrp xpdf-3.03/goo/gfile.cc xpdf-3.04/goo/gfile.cc
if (dir)
closedir(dir);
@@ -769,10 +805,10 @@ GDir::~GDir() {
- GDirEntry *GDir::getNextEntry() {
- GDirEntry *e;
-
--#if defined(WIN32)
-+#if defined(_WIN32)
+#if defined(_WIN32)
if (hnd) {
e = new GDirEntry(path->getCString(), ffd.cFileName, doStat);
- if (hnd && !FindNextFile(hnd, &ffd)) {
@@ -6219,13 +6059,6 @@ diff -uNrp xpdf-3.03/goo/gfile.cc xpdf-3.04/goo/gfile.cc
struct dirent *ent;
e = NULL;
@@ -813,17 +850,18 @@ GDirEntry *GDir::getNextEntry() {
- }
-
- void GDir::rewind() {
--#ifdef WIN32
-+#ifdef _WIN32
- GString *tmp;
-
if (hnd)
FindClose(hnd);
tmp = path->copy();
@@ -6242,15 +6075,6 @@ diff -uNrp xpdf-3.03/goo/gfile.cc xpdf-3.04/goo/gfile.cc
diff -uNrp xpdf-3.03/goo/gfile.h xpdf-3.04/goo/gfile.h
--- xpdf-3.03/goo/gfile.h 2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.04/goo/gfile.h 2014-05-28 20:50:50.000000000 +0200
-@@ -14,7 +14,7 @@
- #include <stdio.h>
- #include <stdlib.h>
- #include <stddef.h>
--#if defined(WIN32)
-+#if defined(_WIN32)
- # include <sys/stat.h>
- # ifdef FPTEX
- # include <win32lib.h>
@@ -24,6 +24,7 @@
#elif defined(ACORN)
#elif defined(MACOS)
@@ -6272,11 +6096,6 @@ diff -uNrp xpdf-3.03/goo/gfile.h xpdf-3.04/goo/gfile.h
// Execute <command>. Returns true on success.
extern GBool executeCommand(char *cmd);
--#ifdef WIN32
-+#ifdef _WIN32
- // Convert a file name from Latin-1 to UTF-8.
- extern GString *fileNameToUTF8(char *path);
-
@@ -106,6 +110,28 @@ extern FILE *openFile(const char *path,
// conventions.
extern char *getLine(char *buf, int size, FILE *f);
@@ -6307,12 +6126,8 @@ diff -uNrp xpdf-3.03/goo/gfile.h xpdf-3.04/goo/gfile.h
// GDir and GDirEntry
//------------------------------------------------------------------------
@@ -136,11 +162,12 @@ private:
-
- GString *path; // directory path
- GBool doStat; // call stat() for each entry?
--#if defined(WIN32)
+#if defined(_WIN32)
- WIN32_FIND_DATA ffd;
-+#if defined(_WIN32)
+ WIN32_FIND_DATAA ffd;
HANDLE hnd;
#elif defined(ACORN)
@@ -6321,18 +6136,6 @@ diff -uNrp xpdf-3.03/goo/gfile.h xpdf-3.04/goo/gfile.h
#else
DIR *dir; // the DIR structure from opendir()
#ifdef VMS
-diff -uNrp xpdf-3.03/goo/GMutex.h xpdf-3.04/goo/GMutex.h
---- xpdf-3.03/goo/GMutex.h 2011-08-15 23:08:53.000000000 +0200
-+++ xpdf-3.04/goo/GMutex.h 2014-05-28 20:50:50.000000000 +0200
-@@ -22,7 +22,7 @@
- // ...
- // gDestroyMutex(&m);
-
--#ifdef WIN32
-+#ifdef _WIN32
-
- #include <windows.h>
-
diff -uNrp xpdf-3.03/goo/Makefile.in xpdf-3.04/goo/Makefile.in
--- xpdf-3.03/goo/Makefile.in 2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.04/goo/Makefile.in 2014-05-28 20:50:50.000000000 +0200
@@ -12914,8 +12717,7 @@ diff -uNrp xpdf-3.03/splash/SplashFontEngine.cc xpdf-3.04/splash/SplashFontEngin
-
#include <stdlib.h>
#include <stdio.h>
--#ifndef WIN32
-+#ifndef _WIN32
+ #ifdef HAVE_UNISTD_H
# include <unistd.h>
#endif
#include "gmem.h"
@@ -12993,7 +12795,7 @@ diff -uNrp xpdf-3.03/splash/SplashFontEngine.cc xpdf-3.04/splash/SplashFontEngin
}
#endif
--#ifndef WIN32
+-#ifndef _WIN32
+#if !LOAD_FONTS_FROM_MEM && !defined(_WIN32)
// delete the (temporary) font file -- with Unix hard link
// semantics, this will remove the last link; otherwise it will
@@ -13030,7 +12832,7 @@ diff -uNrp xpdf-3.03/splash/SplashFontEngine.cc xpdf-3.04/splash/SplashFontEngin
}
#endif
--#ifndef WIN32
+-#ifndef _WIN32
+#if !LOAD_FONTS_FROM_MEM && !defined(_WIN32)
// delete the (temporary) font file -- with Unix hard link
// semantics, this will remove the last link; otherwise it will
@@ -13062,7 +12864,7 @@ diff -uNrp xpdf-3.03/splash/SplashFontEngine.cc xpdf-3.04/splash/SplashFontEngin
}
#endif
--#ifndef WIN32
+-#ifndef _WIN32
+#if !LOAD_FONTS_FROM_MEM && !defined(_WIN32)
// delete the (temporary) font file -- with Unix hard link
// semantics, this will remove the last link; otherwise it will
@@ -13095,7 +12897,7 @@ diff -uNrp xpdf-3.03/splash/SplashFontEngine.cc xpdf-3.04/splash/SplashFontEngin
}
#endif
--#ifndef WIN32
+-#ifndef _WIN32
+#if !LOAD_FONTS_FROM_MEM && !defined(_WIN32)
// delete the (temporary) font file -- with Unix hard link
// semantics, this will remove the last link; otherwise it will
@@ -13128,7 +12930,7 @@ diff -uNrp xpdf-3.03/splash/SplashFontEngine.cc xpdf-3.04/splash/SplashFontEngin
}
#endif
--#ifndef WIN32
+-#ifndef _WIN32
+#if !LOAD_FONTS_FROM_MEM && !defined(_WIN32)
// delete the (temporary) font file -- with Unix hard link
// semantics, this will remove the last link; otherwise it will
@@ -13168,7 +12970,7 @@ diff -uNrp xpdf-3.03/splash/SplashFontEngine.cc xpdf-3.04/splash/SplashFontEngin
gfree(codeToGID);
}
--#ifndef WIN32
+-#ifndef _WIN32
+#if !LOAD_FONTS_FROM_MEM && !defined(_WIN32)
// delete the (temporary) font file -- with Unix hard link
// semantics, this will remove the last link; otherwise it will
@@ -13279,24 +13081,6 @@ diff -uNrp xpdf-3.03/splash/SplashFontEngine.h xpdf-3.04/splash/SplashFontEngine
diff -uNrp xpdf-3.03/splash/SplashFontFile.cc xpdf-3.04/splash/SplashFontFile.cc
--- xpdf-3.03/splash/SplashFontFile.cc 2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.04/splash/SplashFontFile.cc 2014-05-28 20:50:50.000000000 +0200
-@@ -2,6 +2,8 @@
- //
- // SplashFontFile.cc
- //
-+// Copyright 2003-2013 Glyph & Cog, LLC
-+//
- //========================================================================
-
- #include <aconf.h>
-@@ -11,7 +13,7 @@
- #endif
-
- #include <stdio.h>
--#ifndef WIN32
-+#ifndef _WIN32
- # include <unistd.h>
- #endif
- #include "GString.h"
@@ -28,19 +30,32 @@ extern "C" int unlink(char *filename);
// SplashFontFile
//------------------------------------------------------------------------
@@ -13422,24 +13206,6 @@ diff -uNrp xpdf-3.03/splash/SplashFTFont.cc xpdf-3.04/splash/SplashFTFont.cc
diff -uNrp xpdf-3.03/splash/SplashFTFontEngine.cc xpdf-3.04/splash/SplashFTFontEngine.cc
--- xpdf-3.03/splash/SplashFTFontEngine.cc 2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.04/splash/SplashFTFontEngine.cc 2014-05-28 20:50:50.000000000 +0200
-@@ -2,6 +2,8 @@
- //
- // SplashFTFontEngine.cc
- //
-+// Copyright 2003-2013 Glyph & Cog, LLC
-+//
- //========================================================================
-
- #include <aconf.h>
-@@ -13,7 +15,7 @@
- #endif
-
- #include <stdio.h>
--#ifndef WIN32
-+#ifndef _WIN32
- # include <unistd.h>
- #endif
- #include "gmem.h"
@@ -23,6 +25,10 @@
#include "FoFiType1C.h"
#include "SplashFTFontFile.h"
@@ -14355,8 +14121,7 @@ diff -uNrp xpdf-3.03/splash/SplashMath.h xpdf-3.04/splash/SplashMath.h
- : "m" (x));
+ : "t" (x));
return result;
--#elif defined(WIN32) && defined(_M_IX86)
-+#elif defined(_WIN32) && defined(_M_IX86)
+#elif defined(_WIN32) && defined(_M_IX86)
// floor() and (int)() are implemented separately, which results
// in changing the FPCW multiple times - so we optimize it with
// some inline assembly
@@ -14379,8 +14144,7 @@ diff -uNrp xpdf-3.03/splash/SplashMath.h xpdf-3.04/splash/SplashMath.h
- : "m" (x));
+ : "t" (x));
return result;
--#elif defined(WIN32) && defined(_M_IX86)
-+#elif defined(_WIN32) && defined(_M_IX86)
+#elif defined(_WIN32) && defined(_M_IX86)
// ceil() and (int)() are implemented separately, which results
// in changing the FPCW multiple times - so we optimize it with
// some inline assembly
@@ -14403,8 +14167,7 @@ diff -uNrp xpdf-3.03/splash/SplashMath.h xpdf-3.04/splash/SplashMath.h
- : "m" (x));
+ : "t" (x));
return result;
--#elif defined(WIN32) && defined(_M_IX86)
-+#elif defined(_WIN32) && defined(_M_IX86)
+#elif defined(_WIN32) && defined(_M_IX86)
// this could use round-to-nearest mode and avoid the "+0.5",
// but that produces slightly different results (because i+0.5
// sometimes rounds up and sometimes down using the even rule)
@@ -24498,20 +24261,6 @@ diff -uNrp xpdf-3.03/xpdf/Gfx.cc xpdf-3.04/xpdf/Gfx.cc
// Operator table
//------------------------------------------------------------------------
--#ifdef WIN32 // this works around a bug in the VC7 compiler
-+#ifdef _WIN32 // this works around a bug in the VC7 compiler
- # pragma optimize("",off)
- #endif
-
-@@ -257,7 +261,7 @@ Operator Gfx::opTab[] = {
- &Gfx::opCurveTo2},
- };
-
--#ifdef WIN32 // this works around a bug in the VC7 compiler
-+#ifdef _WIN32 // this works around a bug in the VC7 compiler
- # pragma optimize("",on)
- #endif
-
@@ -337,15 +341,31 @@ GfxFont *GfxResources::lookupFont(char *
for (resPtr = this; resPtr; resPtr = resPtr->next) {
@@ -27810,16 +27559,6 @@ diff -uNrp xpdf-3.03/xpdf/GlobalParams.cc xpdf-3.04/xpdf/GlobalParams.cc
#include <stdio.h>
#include <ctype.h>
#ifdef ENABLE_PLUGINS
--# ifndef WIN32
-+# ifndef _WIN32
- # include <dlfcn.h>
- # endif
- #endif
--#ifdef WIN32
-+#ifdef _WIN32
- # include <shlobj.h>
- #endif
- #if HAVE_PAPER_H
@@ -31,6 +35,7 @@
#include "GList.h"
#include "GHash.h"
@@ -27832,22 +27571,12 @@ diff -uNrp xpdf-3.03/xpdf/GlobalParams.cc xpdf-3.04/xpdf/GlobalParams.cc
#endif
#include "GlobalParams.h"
--#ifdef WIN32
-+#ifdef _WIN32
+ #ifdef _WIN32
# define strcasecmp stricmp
+# define strncasecmp strnicmp
#endif
#if MULTITHREADED
-@@ -68,7 +74,7 @@
- #include "UTF8.h"
-
- #ifdef ENABLE_PLUGINS
--# ifdef WIN32
-+# ifdef _WIN32
- extern XpdfPluginVecTable xpdfPluginVecTable;
- # endif
- #endif
@@ -84,25 +90,29 @@ static struct {
const char *name;
const char *t1FileName;
@@ -27925,22 +27654,6 @@ diff -uNrp xpdf-3.03/xpdf/GlobalParams.cc xpdf-3.04/xpdf/GlobalParams.cc
//------------------------------------------------------------------------
GlobalParams *globalParams = NULL;
-@@ -198,13 +229,13 @@ public:
- ~SysFontList();
- SysFontInfo *find(GString *name);
-
--#ifdef WIN32
-+#ifdef _WIN32
- void scanWindowsFonts(char *winFontDir);
- #endif
-
- private:
-
--#ifdef WIN32
-+#ifdef _WIN32
- SysFontInfo *makeWindowsFont(char *name, int fontNum,
- char *path);
- #endif
@@ -241,40 +272,36 @@ SysFontInfo *SysFontList::find(GString *
}
n = name2->getLength();
@@ -28008,15 +27721,6 @@ diff -uNrp xpdf-3.03/xpdf/GlobalParams.cc xpdf-3.04/xpdf/GlobalParams.cc
}
// remove trailing "PS"
-@@ -323,7 +350,7 @@ SysFontInfo *SysFontList::find(GString *
- return fi;
- }
-
--#ifdef WIN32
-+#ifdef _WIN32
- void SysFontList::scanWindowsFonts(char *winFontDir) {
- OSVERSIONINFO version;
- char *path;
@@ -341,15 +368,15 @@ void SysFontList::scanWindowsFonts(char
} else {
path = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Fonts\\";
@@ -28065,81 +27769,17 @@ diff -uNrp xpdf-3.03/xpdf/GlobalParams.cc xpdf-3.04/xpdf/GlobalParams.cc
n -= 8;
}
-@@ -490,7 +517,7 @@ public:
-
- private:
-
--#ifdef WIN32
-+#ifdef _WIN32
- Plugin(HMODULE libA);
- HMODULE lib;
- #else
-@@ -504,7 +531,7 @@ Plugin *Plugin::load(char *type, char *n
- Plugin *plugin;
- XpdfPluginVecTable *vt;
- XpdfBool (*xpdfInitPlugin)(void);
--#ifdef WIN32
-+#ifdef _WIN32
- HMODULE libA;
- #else
- void *dlA;
@@ -515,9 +542,9 @@ Plugin *Plugin::load(char *type, char *n
appendToPath(path, type);
appendToPath(path, name);
--#ifdef WIN32
-+#ifdef _WIN32
+ #ifdef _WIN32
path->append(".dll");
- if (!(libA = LoadLibrary(path->getCString()))) {
+ if (!(libA = LoadLibraryA(path->getCString()))) {
error(errIO, -1, "Failed to load plugin '{0:t}'", path);
goto err1;
}
-@@ -548,7 +575,7 @@ Plugin *Plugin::load(char *type, char *n
- }
- memcpy(vt, &xpdfPluginVecTable, sizeof(xpdfPluginVecTable));
-
--#ifdef WIN32
-+#ifdef _WIN32
- if (!(xpdfInitPlugin = (XpdfBool (*)(void))
- GetProcAddress(libA, "xpdfInitPlugin"))) {
- error(errIO, -1, "Failed to find xpdfInitPlugin in plugin '{0:t}'",
-@@ -568,7 +595,7 @@ Plugin *Plugin::load(char *type, char *n
- goto err2;
- }
-
--#ifdef WIN32
-+#ifdef _WIN32
- plugin = new Plugin(libA);
- #else
- plugin = new Plugin(dlA);
-@@ -578,7 +605,7 @@ Plugin *Plugin::load(char *type, char *n
- return plugin;
-
- err2:
--#ifdef WIN32
-+#ifdef _WIN32
- FreeLibrary(libA);
- #else
- dlclose(dlA);
-@@ -588,7 +615,7 @@ Plugin *Plugin::load(char *type, char *n
- return NULL;
- }
-
--#ifdef WIN32
-+#ifdef _WIN32
- Plugin::Plugin(HMODULE libA) {
- lib = libA;
- }
-@@ -601,7 +628,7 @@ Plugin::Plugin(void *dlA) {
- Plugin::~Plugin() {
- void (*xpdfFreePlugin)(void);
-
--#ifdef WIN32
-+#ifdef _WIN32
- if ((xpdfFreePlugin = (void (*)(void))
- GetProcAddress(lib, "xpdfFreePlugin"))) {
- (*xpdfFreePlugin)();
@@ -621,7 +648,7 @@ Plugin::~Plugin() {
// parsing
//------------------------------------------------------------------------
@@ -28149,15 +27789,6 @@ diff -uNrp xpdf-3.03/xpdf/GlobalParams.cc xpdf-3.04/xpdf/GlobalParams.cc
UnicodeMap *map;
GString *fileName;
FILE *f;
-@@ -644,7 +671,7 @@ GlobalParams::GlobalParams(char *cfgFile
- }
- }
-
--#ifdef WIN32
-+#ifdef _WIN32
- // baseDir will be set by a call to setBaseDir
- baseDir = new GString();
- #else
@@ -660,6 +687,7 @@ GlobalParams::GlobalParams(char *cfgFile
fontFiles = new GHash(gTrue);
fontDirs = new GList();
@@ -28186,11 +27817,6 @@ diff -uNrp xpdf-3.03/xpdf/GlobalParams.cc xpdf-3.04/xpdf/GlobalParams.cc
+ psRasterSliceSize = 20000000;
psAlwaysRasterize = gFalse;
textEncoding = new GString("Latin1");
--#if defined(WIN32)
-+#if defined(_WIN32)
- textEOL = eolDOS;
- #elif defined(MACOS)
- textEOL = eolMac;
@@ -713,10 +745,9 @@ GlobalParams::GlobalParams(char *cfgFile
textEOL = eolUnix;
#endif
@@ -28216,8 +27842,7 @@ diff -uNrp xpdf-3.03/xpdf/GlobalParams.cc xpdf-3.04/xpdf/GlobalParams.cc
}
}
if (!f) {
--#ifdef WIN32
-+#ifdef _WIN32
+ #ifdef _WIN32
char buf[512];
- i = GetModuleFileName(NULL, buf, sizeof(buf));
+ i = GetModuleFileNameA(NULL, buf, sizeof(buf));
@@ -28411,15 +28036,6 @@ diff -uNrp xpdf-3.03/xpdf/GlobalParams.cc xpdf-3.04/xpdf/GlobalParams.cc
if (dir) {
fileName = appendToPath(new GString(dir), displayFontTab[i].t1FileName);
if ((f = fopen(fileName->getCString(), "rb"))) {
-@@ -1931,7 +2026,7 @@ void GlobalParams::setupBaseFonts(char *
- fileName = NULL;
- }
- }
--#ifdef WIN32
-+#ifdef _WIN32
- if (!fileName && winFontDir[0] && displayFontTab[i].ttFileName) {
- fileName = appendToPath(new GString(winFontDir),
- displayFontTab[i].ttFileName);
@@ -1942,13 +2037,67 @@ void GlobalParams::setupBaseFonts(char *
fileName = NULL;
}
@@ -28547,24 +28163,6 @@ diff -uNrp xpdf-3.03/xpdf/GlobalParams.cc xpdf-3.04/xpdf/GlobalParams.cc
if (winFontDir[0]) {
sysFonts->scanWindowsFonts(winFontDir);
}
-@@ -2083,7 +2239,7 @@ FILE *GlobalParams::findToUnicodeFile(GS
- GString *GlobalParams::findFontFile(GString *fontName) {
- static const char *exts[] = { ".pfa", ".pfb", ".ttf", ".ttc" };
- GString *path, *dir;
--#ifdef WIN32
-+#ifdef _WIN32
- GString *fontNameU;
- #endif
- const char *ext;
-@@ -2100,7 +2256,7 @@ GString *GlobalParams::findFontFile(GStr
- dir = (GString *)fontDirs->get(i);
- for (j = 0; j < (int)(sizeof(exts) / sizeof(exts[0])); ++j) {
- ext = exts[j];
--#ifdef WIN32
-+#ifdef _WIN32
- fontNameU = fileNameToUTF8(fontName->getCString());
- path = appendToPath(dir->copy(), fontNameU->getCString());
- delete fontNameU;
@@ -2120,6 +2276,25 @@ GString *GlobalParams::findFontFile(GStr
return NULL;
}
@@ -31385,33 +30983,6 @@ diff -uNrp xpdf-3.03/xpdf/Link.cc xpdf-3.04/xpdf/Link.cc
// unknown action
} else if (obj2.isName()) {
action = new LinkUnknown(obj2.getName());
-@@ -117,7 +141,7 @@ GString *LinkAction::getFileSpecName(Obj
-
- // dictionary
- } else if (fileSpecObj->isDict()) {
--#ifdef WIN32
-+#ifdef _WIN32
- if (!fileSpecObj->dictLookup("DOS", &obj1)->isString()) {
- #else
- if (!fileSpecObj->dictLookup("Unix", &obj1)->isString()) {
-@@ -139,7 +163,7 @@ GString *LinkAction::getFileSpecName(Obj
-
- // system-dependent path manipulation
- if (name) {
--#ifdef WIN32
-+#ifdef _WIN32
- int i, j;
-
- // "//...." --> "\...."
-@@ -517,7 +541,7 @@ LinkLaunch::LinkLaunch(Object *actionObj
- fileName = getFileSpecName(&obj1);
- } else {
- obj1.free();
--#ifdef WIN32
-+#ifdef _WIN32
- if (actionObj->dictLookup("Win", &obj1)->isDict()) {
- obj1.dictLookup("F", &obj2);
- fileName = getFileSpecName(&obj2);
@@ -644,6 +668,98 @@ LinkMovie::~LinkMovie() {
}
@@ -33408,15 +32979,6 @@ diff -uNrp xpdf-3.03/xpdf/PDFCore.cc xpdf-3.04/xpdf/PDFCore.cc
}
}
gfree(pageY);
-@@ -147,7 +152,7 @@ int PDFCore::loadFile(GString *fileName,
- return err;
- }
-
--#ifdef WIN32
-+#ifdef _WIN32
- int PDFCore::loadFile(wchar_t *fileName, int fileNameLen,
- GString *ownerPassword, GString *userPassword) {
- int err;
@@ -423,6 +428,7 @@ void PDFCore::update(int topPageA, int s
// check for changes to the PDF file
@@ -33595,15 +33157,6 @@ diff -uNrp xpdf-3.03/xpdf/PDFCore.h xpdf-3.04/xpdf/PDFCore.h
int page;
};
-@@ -125,7 +129,7 @@ public:
- virtual int loadFile(GString *fileName, GString *ownerPassword = NULL,
- GString *userPassword = NULL);
-
--#ifdef WIN32
-+#ifdef _WIN32
- // Load a new file. Returns pdfOk or error code.
- virtual int loadFile(wchar_t *fileName, int fileNameLen,
- GString *ownerPassword = NULL,
diff -uNrp xpdf-3.03/xpdf/pdfdetach.cc xpdf-3.04/xpdf/pdfdetach.cc
--- xpdf-3.03/xpdf/pdfdetach.cc 2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.04/xpdf/pdfdetach.cc 2014-05-28 20:50:50.000000000 +0200
@@ -33619,69 +33172,6 @@ diff -uNrp xpdf-3.03/xpdf/pdfdetach.cc xpdf-3.04/xpdf/pdfdetach.cc
diff -uNrp xpdf-3.03/xpdf/PDFDoc.cc xpdf-3.04/xpdf/PDFDoc.cc
--- xpdf-3.03/xpdf/PDFDoc.cc 2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.04/xpdf/PDFDoc.cc 2014-05-28 20:50:50.000000000 +0200
-@@ -16,7 +16,7 @@
- #include <stdlib.h>
- #include <stddef.h>
- #include <string.h>
--#ifdef WIN32
-+#ifdef _WIN32
- # include <windows.h>
- #endif
- #include "GString.h"
-@@ -52,7 +52,7 @@ PDFDoc::PDFDoc(GString *fileNameA, GStri
- GString *userPassword, PDFCore *coreA) {
- Object obj;
- GString *fileName1, *fileName2;
--#ifdef WIN32
-+#ifdef _WIN32
- int n, i;
- #endif
-
-@@ -71,7 +71,7 @@ PDFDoc::PDFDoc(GString *fileNameA, GStri
- optContent = NULL;
-
- fileName = fileNameA;
--#ifdef WIN32
-+#ifdef _WIN32
- n = fileName->getLength();
- fileNameU = (wchar_t *)gmallocn(n + 1, sizeof(wchar_t));
- for (i = 0; i < n; ++i) {
-@@ -114,7 +114,7 @@ PDFDoc::PDFDoc(GString *fileNameA, GStri
- ok = setup(ownerPassword, userPassword);
- }
-
--#ifdef WIN32
-+#ifdef _WIN32
- PDFDoc::PDFDoc(wchar_t *fileNameA, int fileNameLen, GString *ownerPassword,
- GString *userPassword, PDFCore *coreA) {
- OSVERSIONINFO version;
-@@ -169,7 +169,7 @@ PDFDoc::PDFDoc(wchar_t *fileNameA, int f
-
- PDFDoc::PDFDoc(BaseStream *strA, GString *ownerPassword,
- GString *userPassword, PDFCore *coreA) {
--#ifdef WIN32
-+#ifdef _WIN32
- int n, i;
- #endif
-
-@@ -178,7 +178,7 @@ PDFDoc::PDFDoc(BaseStream *strA, GString
- core = coreA;
- if (strA->getFileName()) {
- fileName = strA->getFileName()->copy();
--#ifdef WIN32
-+#ifdef _WIN32
- n = fileName->getLength();
- fileNameU = (wchar_t *)gmallocn(n + 1, sizeof(wchar_t));
- for (i = 0; i < n; ++i) {
-@@ -188,7 +188,7 @@ PDFDoc::PDFDoc(BaseStream *strA, GString
- #endif
- } else {
- fileName = NULL;
--#ifdef WIN32
-+#ifdef _WIN32
- fileNameU = NULL;
- #endif
- }
@@ -231,6 +231,7 @@ GBool PDFDoc::setup(GString *ownerPasswo
// read the optional content info
optContent = new OptionalContent(this);
@@ -33690,15 +33180,6 @@ diff -uNrp xpdf-3.03/xpdf/PDFDoc.cc xpdf-3.04/xpdf/PDFDoc.cc
// done
return gTrue;
}
-@@ -294,7 +295,7 @@ PDFDoc::~PDFDoc() {
- if (fileName) {
- delete fileName;
- }
--#ifdef WIN32
-+#ifdef _WIN32
- if (fileNameU) {
- gfree(fileNameU);
- }
@@ -309,10 +310,8 @@ void PDFDoc::checkHeader() {
int i;
@@ -33732,15 +33213,6 @@ diff -uNrp xpdf-3.03/xpdf/PDFDoc.cc xpdf-3.04/xpdf/PDFDoc.cc
}
str->close();
fclose(f);
-@@ -482,7 +482,7 @@ GBool PDFDoc::saveEmbeddedFile(int idx,
- return ret;
- }
-
--#ifdef WIN32
-+#ifdef _WIN32
- GBool PDFDoc::saveEmbeddedFile(int idx, wchar_t *path, int pathLen) {
- FILE *f;
- OSVERSIONINFO version;
@@ -518,14 +518,15 @@ GBool PDFDoc::saveEmbeddedFile(int idx,
GBool PDFDoc::saveEmbeddedFile2(int idx, FILE *f) {
@@ -33800,50 +33272,6 @@ diff -uNrp xpdf-3.03/xpdf/PDFDoc.cc xpdf-3.04/xpdf/PDFDoc.cc
return buf;
}
+
-diff -uNrp xpdf-3.03/xpdf/PDFDoc.h xpdf-3.04/xpdf/PDFDoc.h
---- xpdf-3.03/xpdf/PDFDoc.h 2011-08-15 23:08:53.000000000 +0200
-+++ xpdf-3.04/xpdf/PDFDoc.h 2014-05-28 20:50:50.000000000 +0200
-@@ -39,7 +39,7 @@ public:
-
- PDFDoc(GString *fileNameA, GString *ownerPassword = NULL,
- GString *userPassword = NULL, PDFCore *coreA = NULL);
--#ifdef WIN32
-+#ifdef _WIN32
- PDFDoc(wchar_t *fileNameA, int fileNameLen, GString *ownerPassword = NULL,
- GString *userPassword = NULL, PDFCore *coreA = NULL);
- #endif
-@@ -55,7 +55,7 @@ public:
-
- // Get file name.
- GString *getFileName() { return fileName; }
--#ifdef WIN32
-+#ifdef _WIN32
- wchar_t *getFileNameU() { return fileNameU; }
- #endif
-
-@@ -172,11 +172,12 @@ public:
- int getEmbeddedFileNameLength(int idx)
- { return catalog->getEmbeddedFileNameLength(idx); }
- GBool saveEmbeddedFile(int idx, char *path);
--#ifdef WIN32
-+#ifdef _WIN32
- GBool saveEmbeddedFile(int idx, wchar_t *path, int pathLen);
- #endif
- char *getEmbeddedFileMem(int idx, int *size);
-
-+
- private:
-
- GBool setup(GString *ownerPassword, GString *userPassword);
-@@ -187,7 +188,7 @@ private:
- GBool saveEmbeddedFile2(int idx, FILE *f);
-
- GString *fileName;
--#ifdef WIN32
-+#ifdef _WIN32
- wchar_t *fileNameU;
- #endif
- FILE *file;
diff -uNrp xpdf-3.03/xpdf/pdffonts.cc xpdf-3.04/xpdf/pdffonts.cc
--- xpdf-3.03/xpdf/pdffonts.cc 2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.04/xpdf/pdffonts.cc 2014-05-28 20:50:50.000000000 +0200
@@ -35530,15 +34958,6 @@ diff -uNrp xpdf-3.03/xpdf/PSOutputDev.cc xpdf-3.04/xpdf/PSOutputDev.cc
imgIDs = NULL;
formIDs = NULL;
xobjStack = NULL;
-@@ -1019,7 +1071,7 @@ PSOutputDev::PSOutputDev(char *fileName,
- } else if (fileName[0] == '|') {
- fileTypeA = psPipe;
- #ifdef HAVE_POPEN
--#ifndef WIN32
-+#ifndef _WIN32
- signal(SIGPIPE, (SignalFunc)SIG_IGN);
- #endif
- if (!(f = popen(fileName + 1, "w"))) {
@@ -1060,11 +1112,8 @@ PSOutputDev::PSOutputDev(PSOutputFunc ou
customCodeCbk = customCodeCbkA;
customCodeCbkData = customCodeCbkDataA;
@@ -35620,15 +35039,6 @@ diff -uNrp xpdf-3.03/xpdf/PSOutputDev.cc xpdf-3.04/xpdf/PSOutputDev.cc
if (ok) {
if (!manualCtrl) {
-@@ -1243,7 +1293,7 @@ PSOutputDev::~PSOutputDev() {
- #ifdef HAVE_POPEN
- else if (fileType == psPipe) {
- pclose((FILE *)outputStream);
--#ifndef WIN32
-+#ifndef _WIN32
- signal(SIGPIPE, (SignalFunc)SIG_DFL);
- #endif
- }
@@ -1255,30 +1305,8 @@ PSOutputDev::~PSOutputDev() {
if (embFontList) {
delete embFontList;
@@ -39561,15 +38971,6 @@ diff -uNrp xpdf-3.03/xpdf/SplashOutputDev.h xpdf-3.04/xpdf/SplashOutputDev.h
diff -uNrp xpdf-3.03/xpdf/Stream.cc xpdf-3.04/xpdf/Stream.cc
--- xpdf-3.03/xpdf/Stream.cc 2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.04/xpdf/Stream.cc 2014-05-28 20:50:50.000000000 +0200
-@@ -16,7 +16,7 @@
- #include <stdlib.h>
- #include <stddef.h>
- #include <limits.h>
--#ifndef WIN32
-+#ifndef _WIN32
- #include <unistd.h>
- #endif
- #include <string.h>
@@ -98,11 +98,29 @@ char *Stream::getLine(char *buf, int siz
return buf;
}
@@ -41264,24 +40665,6 @@ diff -uNrp xpdf-3.03/xpdf/Stream.h xpdf-3.04/xpdf/Stream.h
diff -uNrp xpdf-3.03/xpdf/TextOutputDev.cc xpdf-3.04/xpdf/TextOutputDev.cc
--- xpdf-3.03/xpdf/TextOutputDev.cc 2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.04/xpdf/TextOutputDev.cc 2014-05-28 20:50:50.000000000 +0200
-@@ -2,7 +2,7 @@
- //
- // TextOutputDev.cc
- //
--// Copyright 1997-2003 Glyph & Cog, LLC
-+// Copyright 1997-2014 Glyph & Cog, LLC
- //
- //========================================================================
-
-@@ -17,7 +17,7 @@
- #include <stddef.h>
- #include <math.h>
- #include <ctype.h>
--#ifdef WIN32
-+#ifdef _WIN32
- #include <fcntl.h> // for O_BINARY
- #include <io.h> // for setmode
- #endif
@@ -33,82 +33,48 @@
#include "Link.h"
#include "TextOutputDev.h"
@@ -51577,18 +50960,6 @@ diff -uNrp xpdf-3.03/xpdf/XPDFCore.cc xpdf-3.04/xpdf/XPDFCore.cc
}
void XPDFCore::updateScrollbars() {
-diff -uNrp xpdf-3.03/xpdf/XpdfPluginAPI.cc xpdf-3.04/xpdf/XpdfPluginAPI.cc
---- xpdf-3.03/xpdf/XpdfPluginAPI.cc 2011-08-15 23:08:53.000000000 +0200
-+++ xpdf-3.04/xpdf/XpdfPluginAPI.cc 2014-05-28 20:50:50.000000000 +0200
-@@ -14,7 +14,7 @@
- #include "GlobalParams.h"
- #include "Object.h"
- #include "PDFDoc.h"
--#ifdef WIN32
-+#ifdef _WIN32
- #include "WinPDFCore.h"
- #else
- #include "XPDFCore.h"
diff -uNrp xpdf-3.03/xpdf/XPDFViewer.cc xpdf-3.04/xpdf/XPDFViewer.cc
--- xpdf-3.03/xpdf/XPDFViewer.cc 2011-08-15 23:08:53.000000000 +0200
+++ xpdf-3.04/xpdf/XPDFViewer.cc 2014-05-28 20:50:50.000000000 +0200
diff --git a/CHANGES-3.04 b/CHANGES-3.04
index e18c1c5..cf9c826 100644
--- a/CHANGES-3.04
+++ b/CHANGES-3.04
@@ -38,7 +38,6 @@ Pdftops was not correctly handling the case where it couldn't find
a 16-bit font -- this led to crashes and/or invalid PostScript.
A bug in FlateStream::getBlock() was causing problems with narrow
images.
-Use the correct _WIN32 define instead of WIN32.
Use copy-on-write for the clip path in SplashState (when doing gsave),
for performance.
Added a Solaris-specific entry to the ghostscript font search path.