[poppler] goo/gfile.cc goo/gfile.h goo/GooMutex.h msvc/poppler poppler/ABWOutputDev.h poppler-config.h.cmake poppler/FileSpec.cc poppler/GlobalParams.cc poppler/GlobalParams.h poppler/Link.cc poppler/PDFDoc.cc poppler/PDFDoc.h poppler/poppler-config.h.in poppler/PSOutputDev.cc poppler/TextOutputDev.cc poppler/XpdfPluginAPI.cc splash/SplashFontEngine.cc test/perf-test.cc utils/HtmlOutputDev.h

Albert Astals Cid aacid at kemper.freedesktop.org
Sun Oct 4 15:40:11 PDT 2009


 goo/GooMutex.h                |   16 +++++++++++++++-
 goo/gfile.cc                  |   33 +++++++++++++++++----------------
 goo/gfile.h                   |    5 +++--
 msvc/poppler/poppler-config.h |    2 +-
 poppler-config.h.cmake        |    2 +-
 poppler/ABWOutputDev.h        |    3 ++-
 poppler/FileSpec.cc           |    7 ++++---
 poppler/GlobalParams.cc       |   37 +++++++++++++++++++------------------
 poppler/GlobalParams.h        |    4 ++--
 poppler/Link.cc               |    3 ++-
 poppler/PDFDoc.cc             |    4 ++--
 poppler/PDFDoc.h              |    3 ++-
 poppler/PSOutputDev.cc        |    5 +++--
 poppler/TextOutputDev.cc      |    5 +++--
 poppler/XpdfPluginAPI.cc      |   13 ++++++++++++-
 poppler/poppler-config.h.in   |    2 +-
 splash/SplashFontEngine.cc    |    9 +++++----
 test/perf-test.cc             |   24 ++++++++++++------------
 utils/HtmlOutputDev.h         |    3 ++-
 19 files changed, 108 insertions(+), 72 deletions(-)

New commits:
commit 091f68ccd59413d6890dfbfcf8911f112e690b50
Author: Kovid Goyal <kovid at kovidgoyal.net>
Date:   Mon Oct 5 00:39:36 2009 +0200

    Use _WIN32 instead of WIN32
    
    More info at http://bugs.freedesktop.org/show_bug.cgi?id=24259

diff --git a/goo/GooMutex.h b/goo/GooMutex.h
index f78a14b..3f53a62 100644
--- a/goo/GooMutex.h
+++ b/goo/GooMutex.h
@@ -8,6 +8,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) 2009 Kovid Goyal <kovid at kovidgoyal.net>
+//
+// 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 GMUTEX_H
 #define GMUTEX_H
 
@@ -22,7 +36,7 @@
 // ...
 // gDestroyMutex(&m);
 
-#ifdef WIN32
+#ifdef _WIN32
 
 #include <windows.h>
 
diff --git a/goo/gfile.cc b/goo/gfile.cc
index e95e52c..e875630 100644
--- a/goo/gfile.cc
+++ b/goo/gfile.cc
@@ -20,6 +20,7 @@
 // Copyright (C) 2008 Adam Batkin <adam at batkin.net>
 // Copyright (C) 2008 Hib Eris <hib at hiberis.nl>
 // Copyright (C) 2009 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2009 Kovid Goyal <kovid at kovidgoyal.net>
 //
 // 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
@@ -28,7 +29,7 @@
 
 #include <config.h>
 
-#ifdef WIN32
+#ifdef _WIN32
 #  include <time.h>
 #else
 #  if defined(MACOS)
@@ -46,7 +47,7 @@
 #  if defined(VMS) && (__DECCXX_VER < 50200000)
 #    include <unixlib.h>
 #  endif
-#endif // WIN32
+#endif // _WIN32
 #include "GooString.h"
 #include "gfile.h"
 
@@ -63,7 +64,7 @@ GooString *getHomeDir() {
   //---------- VMS ----------
   return new GooString("SYS$LOGIN:");
 
-#elif defined(__EMX__) || defined(WIN32)
+#elif defined(__EMX__) || defined(_WIN32)
   //---------- OS/2+EMX and Win32 ----------
   char *s;
   GooString *ret;
@@ -109,7 +110,7 @@ GooString *getCurrentDir() {
 
 #if defined(__EMX__)
   if (_getcwd2(buf, sizeof(buf)))
-#elif defined(WIN32)
+#elif defined(_WIN32)
   if (GetCurrentDirectory(sizeof(buf), buf))
 #elif defined(ACORN)
   if (strcpy(buf, "@"))
@@ -163,7 +164,7 @@ GooString *appendToPath(GooString *path, char *fileName) {
   }
   return path;
 
-#elif defined(WIN32)
+#elif defined(_WIN32)
   //---------- Win32 ----------
   GooString *tmp;
   char buf[256];
@@ -299,7 +300,7 @@ GooString *grabPath(char *fileName) {
     return new GooString(fileName, p + 1 - fileName);
   return new GooString();
 
-#elif defined(__EMX__) || defined(WIN32)
+#elif defined(__EMX__) || defined(_WIN32)
   //---------- OS/2+EMX and Win32 ----------
   char *p;
 
@@ -343,7 +344,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] == ':';
 
@@ -373,7 +374,7 @@ GooString *makePathAbsolute(GooString *path) {
   }
   return path;
 
-#elif defined(WIN32)
+#elif defined(_WIN32)
   //---------- Win32 ----------
   char buf[_MAX_PATH];
   char *fp;
@@ -444,7 +445,7 @@ GooString *makePathAbsolute(GooString *path) {
 }
 
 time_t getModTime(char *fileName) {
-#ifdef WIN32
+#ifdef _WIN32
   //~ should implement this, but it's (currently) only used in xpdf
   return 0;
 #else
@@ -458,7 +459,7 @@ time_t getModTime(char *fileName) {
 }
 
 GBool openTempFile(GooString **name, FILE **f, char *mode) {
-#if defined(WIN32)
+#if defined(_WIN32)
   //---------- Win32 ----------
   char *tempDir;
   GooString *s, *s2;
@@ -585,7 +586,7 @@ char *getLine(char *buf, int size, FILE *f) {
 GDirEntry::GDirEntry(char *dirPath, char *nameA, GBool doStat) {
 #ifdef VMS
   char *p;
-#elif defined(WIN32)
+#elif defined(_WIN32)
   DWORD fa;
 #elif defined(ACORN)
 #else
@@ -603,7 +604,7 @@ GDirEntry::GDirEntry(char *dirPath, char *nameA, GBool doStat) {
       dir = gTrue;
 #elif defined(ACORN)
 #else
-#ifdef WIN32
+#ifdef _WIN32
     fa = GetFileAttributes(fullPath->getCString());
     dir = (fa != 0xFFFFFFFF && (fa & FILE_ATTRIBUTE_DIRECTORY));
 #else
@@ -622,7 +623,7 @@ GDirEntry::~GDirEntry() {
 GDir::GDir(char *name, GBool doStatA) {
   path = new GooString(name);
   doStat = doStatA;
-#if defined(WIN32)
+#if defined(_WIN32)
   GooString *tmp;
 
   tmp = path->copy();
@@ -641,7 +642,7 @@ GDir::GDir(char *name, GBool doStatA) {
 
 GDir::~GDir() {
   delete path;
-#if defined(WIN32)
+#if defined(_WIN32)
   if (hnd != INVALID_HANDLE_VALUE) {
     FindClose(hnd);
     hnd = INVALID_HANDLE_VALUE;
@@ -657,7 +658,7 @@ GDir::~GDir() {
 GDirEntry *GDir::getNextEntry() {
   GDirEntry *e;
 
-#if defined(WIN32)
+#if defined(_WIN32)
   if (hnd != INVALID_HANDLE_VALUE) {
     e = new GDirEntry(path->getCString(), ffd.cFileName, doStat);
     if (!FindNextFile(hnd, &ffd)) {
@@ -701,7 +702,7 @@ GDirEntry *GDir::getNextEntry() {
 }
 
 void GDir::rewind() {
-#ifdef WIN32
+#ifdef _WIN32
   GooString *tmp;
 
   if (hnd != INVALID_HANDLE_VALUE)
diff --git a/goo/gfile.h b/goo/gfile.h
index aaa2a16..17aea02 100644
--- a/goo/gfile.h
+++ b/goo/gfile.h
@@ -17,6 +17,7 @@
 //
 // Copyright (C) 2006 Kristian Høgsberg <krh at redhat.com>
 // Copyright (C) 2009 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2009 Kovid Goyal <kovid at kovidgoyal.net>
 //
 // 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
@@ -30,7 +31,7 @@
 #include <stdlib.h>
 #include <stddef.h>
 extern "C" {
-#if defined(WIN32)
+#if defined(_WIN32)
 #  include <sys/stat.h>
 #  ifdef FPTEX
 #    include <win32lib.h>
@@ -141,7 +142,7 @@ private:
 
   GooString *path;		// directory path
   GBool doStat;			// call stat() for each entry?
-#if defined(WIN32)
+#if defined(_WIN32)
   WIN32_FIND_DATA ffd;
   HANDLE hnd;
 #elif defined(ACORN)
diff --git a/msvc/poppler/poppler-config.h b/msvc/poppler/poppler-config.h
index f925ad4..487fb13 100644
--- a/msvc/poppler/poppler-config.h
+++ b/msvc/poppler/poppler-config.h
@@ -44,7 +44,7 @@
 #define pclose _pclose
 #endif
 
-#if defined(VMS) || defined(VMCMS) || defined(DOS) || defined(OS2) || defined(__EMX__) || defined(WIN32) || defined(__DJGPP__) || defined(MACOS)
+#if defined(VMS) || defined(VMCMS) || defined(DOS) || defined(OS2) || defined(__EMX__) || defined(_WIN32) || defined(__DJGPP__) || defined(MACOS)
 #define POPEN_READ_MODE "rb"
 #else
 #define POPEN_READ_MODE "r"
diff --git a/poppler-config.h.cmake b/poppler-config.h.cmake
index 9ffe64e..5122a4e 100644
--- a/poppler-config.h.cmake
+++ b/poppler-config.h.cmake
@@ -59,7 +59,7 @@
 #define pclose _pclose
 #endif
 
-#if defined(VMS) || defined(VMCMS) || defined(DOS) || defined(OS2) || defined(__EMX__) || defined(WIN32) || defined(__DJGPP__) || defined(MACOS)
+#if defined(VMS) || defined(VMCMS) || defined(DOS) || defined(OS2) || defined(__EMX__) || defined(_WIN32) || defined(__DJGPP__) || defined(MACOS)
 #define POPEN_READ_MODE "rb"
 #else
 #define POPEN_READ_MODE "r"
diff --git a/poppler/ABWOutputDev.h b/poppler/ABWOutputDev.h
index 426d3fb..450b7dd 100644
--- a/poppler/ABWOutputDev.h
+++ b/poppler/ABWOutputDev.h
@@ -3,6 +3,7 @@
 // ABWOutputDev.h
 //
 // Copyright 2006-2007 Jauco Noordzij <jauco at jauco.nl>
+// Copyright (C) 2009 Kovid Goyal <kovid at kovidgoyal.net>
 //
 //========================================================================
 
@@ -27,7 +28,7 @@
 #include <libxml/xpath.h>
 #include <libxml/xpathInternals.h>
 
-#ifdef WIN32
+#ifdef _WIN32
 #  define SLASH '\\'
 #else
 #  define SLASH '/'
diff --git a/poppler/FileSpec.cc b/poppler/FileSpec.cc
index a788cd8..4df6139 100644
--- a/poppler/FileSpec.cc
+++ b/poppler/FileSpec.cc
@@ -6,6 +6,7 @@
 // under GPL version 2 or later
 //
 // Copyright (C) 2008-2009 Carlos Garcia Campos <carlosgc at gnome.org>
+// Copyright (C) 2009 Kovid Goyal <kovid at kovidgoyal.net>
 //
 // 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
@@ -73,7 +74,7 @@ GBool getFileSpecNameForPlatform (Object *fileSpec, Object *fileName)
       fileName->free();
       if (!fileSpec->dictLookup("F", fileName)->isString ()) {
         fileName->free();
-#ifdef WIN32
+#ifdef _WIN32
 	char *platform = "DOS";
 #else
 	char *platform = "Unix";
@@ -91,7 +92,7 @@ GBool getFileSpecNameForPlatform (Object *fileSpec, Object *fileName)
   }
 
   // system-dependent path manipulation
-#ifdef WIN32
+#ifdef _WIN32
   int i, j;
   GooString *name = fileName->getString();
   // "//...."             --> "\...."
@@ -133,7 +134,7 @@ GBool getFileSpecNameForPlatform (Object *fileSpec, Object *fileName)
       name->del(i);
     }
   }
-#endif /* WIN32 */
+#endif /* _WIN32 */
 
   return gTrue;
 }
diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc
index 3cd9ccb..0155132 100644
--- a/poppler/GlobalParams.cc
+++ b/poppler/GlobalParams.cc
@@ -21,6 +21,7 @@
 // Copyright (C) 2007, 2009 Jonathan Kew <jonathan_kew at sil.org>
 // Copyright (C) 2009 Petr Gajdos <pgajdos at novell.com>
 // Copyright (C) 2009 William Bader <williambader at hotmail.com>
+// Copyright (C) 2009 Kovid Goyal <kovid at kovidgoyal.net>
 //
 // 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
@@ -37,11 +38,11 @@
 #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
 #include "goo/gmem.h"
@@ -62,7 +63,7 @@
 #include "GlobalParams.h"
 #include "GfxFont.h"
 
-#ifdef WIN32
+#ifdef _WIN32
 #  define strcasecmp stricmp
 #endif
 
@@ -91,7 +92,7 @@
 #include "UTF8.h"
 
 #ifdef ENABLE_PLUGINS
-#  ifdef WIN32
+#  ifdef _WIN32
 extern XpdfPluginVecTable xpdfPluginVecTable;
 #  endif
 #endif
@@ -139,7 +140,7 @@ DisplayFontParam::~DisplayFontParam() {
   }
 }
 
-#ifdef WIN32
+#ifdef _WIN32
 
 //------------------------------------------------------------------------
 // WinFontInfo
@@ -382,7 +383,7 @@ int CALLBACK WinFontList::enumFunc2(CONST LOGFONT *font,
   return 1;
 }
 
-#endif // WIN32
+#endif // _WIN32
 
 //------------------------------------------------------------------------
 // PSFontParam
@@ -417,7 +418,7 @@ public:
 
 private:
 
-#ifdef WIN32
+#ifdef _WIN32
   Plugin(HMODULE libA);
   HMODULE lib;
 #else
@@ -431,7 +432,7 @@ Plugin *Plugin::load(char *type, char *name) {
   Plugin *plugin;
   XpdfPluginVecTable *vt;
   XpdfBool (*xpdfInitPlugin)(void);
-#ifdef WIN32
+#ifdef _WIN32
   HMODULE libA;
 #else
   void *dlA;
@@ -442,7 +443,7 @@ Plugin *Plugin::load(char *type, char *name) {
   appendToPath(path, type);
   appendToPath(path, name);
 
-#ifdef WIN32
+#ifdef _WIN32
   path->append(".dll");
   if (!(libA = LoadLibrary(path->getCString()))) {
     error(-1, "Failed to load plugin '%s'",
@@ -476,7 +477,7 @@ Plugin *Plugin::load(char *type, char *name) {
   }
   memcpy(vt, &xpdfPluginVecTable, sizeof(xpdfPluginVecTable));
 
-#ifdef WIN32
+#ifdef _WIN32
   if (!(xpdfInitPlugin = (XpdfBool (*)(void))
 	                     GetProcAddress(libA, "xpdfInitPlugin"))) {
     error(-1, "Failed to find xpdfInitPlugin in plugin '%s'",
@@ -497,7 +498,7 @@ Plugin *Plugin::load(char *type, char *name) {
     goto err2;
   }
 
-#ifdef WIN32
+#ifdef _WIN32
   plugin = new Plugin(libA);
 #else
   plugin = new Plugin(dlA);
@@ -507,7 +508,7 @@ Plugin *Plugin::load(char *type, char *name) {
   return plugin;
 
  err2:
-#ifdef WIN32
+#ifdef _WIN32
   FreeLibrary(libA);
 #else
   dlclose(dlA);
@@ -517,7 +518,7 @@ Plugin *Plugin::load(char *type, char *name) {
   return NULL;
 }
 
-#ifdef WIN32
+#ifdef _WIN32
 Plugin::Plugin(HMODULE libA) {
   lib = libA;
 }
@@ -530,7 +531,7 @@ Plugin::Plugin(void *dlA) {
 Plugin::~Plugin() {
   void (*xpdfFreePlugin)(void);
 
-#ifdef WIN32
+#ifdef _WIN32
   if ((xpdfFreePlugin = (void (*)(void))
                             GetProcAddress(lib, "xpdfFreePlugin"))) {
     (*xpdfFreePlugin)();
@@ -578,7 +579,7 @@ GlobalParams::GlobalParams(const char *customPopplerDataDir)
     }
   }
 
-#ifdef WIN32
+#ifdef _WIN32
   // baseDir will be set by a call to setBaseDir
   baseDir = new GooString();
 #else
@@ -608,7 +609,7 @@ GlobalParams::GlobalParams(const char *customPopplerDataDir)
   psOPI = gFalse;
   psASCIIHex = gFalse;
   textEncoding = new GooString("UTF-8");
-#if defined(WIN32)
+#if defined(_WIN32)
   textEOL = eolDOS;
 #elif defined(MACOS)
   textEOL = eolMac;
@@ -641,7 +642,7 @@ GlobalParams::GlobalParams(const char *customPopplerDataDir)
   unicodeMapCache = new UnicodeMapCache();
   cMapCache = new CMapCache();
 
-#ifdef WIN32
+#ifdef _WIN32
   baseFontsInitialized = gFalse;
   winFontList = NULL;
 #endif
@@ -806,7 +807,7 @@ GlobalParams::~GlobalParams() {
   deleteGooHash(unicodeMaps, GooString);
   deleteGooList(toUnicodeDirs, GooString);
   deleteGooHash(displayFonts, DisplayFontParam);
-#ifdef WIN32
+#ifdef _WIN32
   delete winFontList;
 #endif
   deleteGooHash(psFonts, PSFontParam);
diff --git a/poppler/GlobalParams.h b/poppler/GlobalParams.h
index 10537a4..cb2aa85 100644
--- a/poppler/GlobalParams.h
+++ b/poppler/GlobalParams.h
@@ -61,7 +61,7 @@ struct XpdfSecurityHandler;
 class GlobalParams;
 class GfxFont;
 class Stream;
-#ifdef WIN32
+#ifdef _WIN32
 class WinFontList;
 #endif
 
@@ -305,7 +305,7 @@ private:
   GooList *toUnicodeDirs;		// list of ToUnicode CMap dirs [GooString]
   GooHash *displayFonts;		// display font info, indexed by font name
 				//   [DisplayFontParam]
-#ifdef WIN32
+#ifdef _WIN32
   GBool baseFontsInitialized;
   WinFontList *winFontList;	// system TrueType fonts
 #endif
diff --git a/poppler/Link.cc b/poppler/Link.cc
index 7cb7aeb..1f66677 100644
--- a/poppler/Link.cc
+++ b/poppler/Link.cc
@@ -17,6 +17,7 @@
 // Copyright (C) 2007 Carlos Garcia Campos <carlosgc at gnome.org>
 // Copyright (C) 2008 Hugo Mercier <hmercier31 at gmail.com>
 // Copyright (C) 2008, 2009 Albert Astals Cid <aacid at kde.org>
+// Copyright (C) 2009 Kovid Goyal <kovid at kovidgoyal.net>
 //
 // 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
@@ -476,7 +477,7 @@ LinkLaunch::LinkLaunch(Object *actionObj) {
       }
     } else {
       obj1.free();
-#ifdef WIN32
+#ifdef _WIN32
       if (actionObj->dictLookup("Win", &obj1)->isDict()) {
 	obj1.dictLookup("F", &obj2);
 	if (getFileSpecNameForPlatform (&obj2, &obj3)) {
diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc
index f1f1a8f..4af402b 100644
--- a/poppler/PDFDoc.cc
+++ b/poppler/PDFDoc.cc
@@ -39,7 +39,7 @@
 #include <stddef.h>
 #include <string.h>
 #include <time.h>
-#ifdef WIN32
+#ifdef _WIN32
 #  include <windows.h>
 #endif
 #include "goo/gstrtod.h"
@@ -115,7 +115,7 @@ PDFDoc::PDFDoc(GooString *fileNameA, GooString *ownerPassword,
   ok = setup(ownerPassword, userPassword);
 }
 
-#ifdef WIN32
+#ifdef _WIN32
 PDFDoc::PDFDoc(wchar_t *fileNameA, int fileNameLen, GooString *ownerPassword,
 	       GooString *userPassword, void *guiDataA) {
   OSVERSIONINFO version;
diff --git a/poppler/PDFDoc.h b/poppler/PDFDoc.h
index 7527316..3db4b91 100644
--- a/poppler/PDFDoc.h
+++ b/poppler/PDFDoc.h
@@ -19,6 +19,7 @@
 // Copyright (C) 2008 Pino Toscano <pino at kde.org>
 // Copyright (C) 2008 Carlos Garcia Campos <carlosgc at gnome.org>
 // Copyright (C) 2009 Eric Toombs <ewtoombs at uwaterloo.ca>
+// Copyright (C) 2009 Kovid Goyal <kovid at kovidgoyal.net>
 //
 // 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
@@ -63,7 +64,7 @@ public:
   PDFDoc(GooString *fileNameA, GooString *ownerPassword = NULL,
 	 GooString *userPassword = NULL, void *guiDataA = NULL);
 
-#ifdef WIN32
+#ifdef _WIN32
   PDFDoc(wchar_t *fileNameA, int fileNameLen, GooString *ownerPassword = NULL,
 	 GooString *userPassword = NULL, void *guiDataA = NULL);
 #endif
diff --git a/poppler/PSOutputDev.cc b/poppler/PSOutputDev.cc
index 9967892..2529b97 100644
--- a/poppler/PSOutputDev.cc
+++ b/poppler/PSOutputDev.cc
@@ -24,6 +24,7 @@
 // Copyright (C) 2009 Till Kamppeter <till.kamppeter at gmail.com>
 // Copyright (C) 2009 Carlos Garcia Campos <carlosgc at gnome.org>
 // Copyright (C) 2009 William Bader <williambader at hotmail.com>
+// Copyright (C) 2009 Kovid Goyal <kovid at kovidgoyal.net>
 //
 // 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
@@ -1008,7 +1009,7 @@ PSOutputDev::PSOutputDev(const char *fileName, XRef *xrefA, Catalog *catalog,
   } 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"))) {
@@ -1219,7 +1220,7 @@ PSOutputDev::~PSOutputDev() {
 #ifdef HAVE_POPEN
     else if (fileType == psPipe) {
       pclose((FILE *)outputStream);
-#ifndef WIN32
+#ifndef _WIN32
       signal(SIGPIPE, (SignalFunc)SIG_DFL);
 #endif
     }
diff --git a/poppler/TextOutputDev.cc b/poppler/TextOutputDev.cc
index c0599ce..442ace2 100644
--- a/poppler/TextOutputDev.cc
+++ b/poppler/TextOutputDev.cc
@@ -21,6 +21,7 @@
 // Copyright (C) 2008 Pino Toscano <pino at kde.org>
 // Copyright (C) 2008 Hib Eris <hib at hiberis.nl>
 // Copyright (C) 2009 Ross Moore <ross at maths.mq.edu.au>
+// Copyright (C) 2009 Kovid Goyal <kovid at kovidgoyal.net>
 //
 // 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
@@ -38,7 +39,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
@@ -4631,7 +4632,7 @@ TextOutputDev::TextOutputDev(char *fileName, GBool physLayoutA,
   if (fileName) {
     if (!strcmp(fileName, "-")) {
       outputStream = stdout;
-#ifdef WIN32
+#ifdef _WIN32
       // keep DOS from munging the end-of-line characters
       setmode(fileno(stdout), O_BINARY);
 #endif
diff --git a/poppler/XpdfPluginAPI.cc b/poppler/XpdfPluginAPI.cc
index aefd547..94d2851 100644
--- a/poppler/XpdfPluginAPI.cc
+++ b/poppler/XpdfPluginAPI.cc
@@ -6,6 +6,17 @@
 //
 //========================================================================
 
+//========================================================================
+//
+// Modified under the Poppler project - http://poppler.freedesktop.org
+//
+// Copyright (C) 2009 Kovid Goyal <kovid at kovidgoyal.net>
+//
+// 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
+//
+//========================================================================
+
 #include "config.h"
 
 #ifdef ENABLE_PLUGINS
@@ -14,7 +25,7 @@
 #include "GlobalParams.h"
 #include "Object.h"
 #include "PDFDoc.h"
-#ifdef WIN32
+#ifdef _WIN32
 #include "WinPDFCore.h"
 #else
 #include "XPDFCore.h"
diff --git a/poppler/poppler-config.h.in b/poppler/poppler-config.h.in
index 6a8ec60..016a081 100644
--- a/poppler/poppler-config.h.in
+++ b/poppler/poppler-config.h.in
@@ -59,7 +59,7 @@
 #define pclose _pclose
 #endif
 
-#if defined(VMS) || defined(VMCMS) || defined(DOS) || defined(OS2) || defined(__EMX__) || defined(WIN32) || defined(__DJGPP__) || defined(MACOS)
+#if defined(VMS) || defined(VMCMS) || defined(DOS) || defined(OS2) || defined(__EMX__) || defined(_WIN32) || defined(__DJGPP__) || defined(MACOS)
 #define POPEN_READ_MODE "rb"
 #else
 #define POPEN_READ_MODE "r"
diff --git a/splash/SplashFontEngine.cc b/splash/SplashFontEngine.cc
index b089c88..fb1a950 100644
--- a/splash/SplashFontEngine.cc
+++ b/splash/SplashFontEngine.cc
@@ -13,6 +13,7 @@
 //
 // Copyright (C) 2006 Takashi Iwai <tiwai at suse.de>
 // Copyright (C) 2009 Petr Gajdos <pgajdos at novell.com>
+// Copyright (C) 2009 Kovid Goyal <kovid at kovidgoyal.net>
 //
 // 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
@@ -144,7 +145,7 @@ SplashFontFile *SplashFontEngine::loadType1Font(SplashFontFileID *idA,
   }
 #endif
 
-#ifndef WIN32
+#ifndef _WIN32
   // delete the (temporary) font file -- with Unix hard link
   // semantics, this will remove the last link; otherwise it will
   // return an error, leaving the file to be deleted later (if
@@ -173,7 +174,7 @@ SplashFontFile *SplashFontEngine::loadType1CFont(SplashFontFileID *idA,
   }
 #endif
 
-#ifndef WIN32
+#ifndef _WIN32
   // delete the (temporary) font file -- with Unix hard link
   // semantics, this will remove the last link; otherwise it will
   // return an error, leaving the file to be deleted later (if
@@ -218,7 +219,7 @@ SplashFontFile *SplashFontEngine::loadCIDFont(SplashFontFileID *idA,
   }
 #endif
 
-#ifndef WIN32
+#ifndef _WIN32
   // delete the (temporary) font file -- with Unix hard link
   // semantics, this will remove the last link; otherwise it will
   // return an error, leaving the file to be deleted later (if
@@ -270,7 +271,7 @@ SplashFontFile *SplashFontEngine::loadTrueTypeFont(SplashFontFileID *idA,
     gfree(codeToGID);
   }
 
-#ifndef WIN32
+#ifndef _WIN32
   // delete the (temporary) font file -- with Unix hard link
   // semantics, this will remove the last link; otherwise it will
   // return an error, leaving the file to be deleted later (if
diff --git a/test/perf-test.cc b/test/perf-test.cc
index 4de17ae..a11a377 100644
--- a/test/perf-test.cc
+++ b/test/perf-test.cc
@@ -20,7 +20,7 @@
 #pragma comment(linker,"/manifestdependency:\"type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='x86' publicKeyToken='6595b64144ccf1df' language='*'\"")
 #endif
 
-#ifdef WIN32
+#ifdef _WIN32
 #include <windows.h>
 #endif
 
@@ -297,7 +297,7 @@ bool str_endswith(const char *txt, const char *end)
    sleep_milliseconds */
 void sleep_milliseconds(int milliseconds)
 {
-#ifdef WIN32
+#ifdef _WIN32
     Sleep((DWORD)milliseconds);
 #else
     struct timespec tv;
@@ -456,7 +456,7 @@ struct FindFileState {
     char dirpath[MAX_FILENAME_SIZE]; /* current dir path */
     char pattern[MAX_FILENAME_SIZE]; /* search pattern */
     const char *bufptr;
-#ifdef WIN32
+#ifdef _WIN32
     WIN32_FIND_DATA fileinfo;
     HANDLE dir;
 #else
@@ -464,7 +464,7 @@ struct FindFileState {
 #endif
 };
 
-#ifdef WIN32
+#ifdef _WIN32
 #include <windows.h>
 #include <sys/timeb.h>
 #include <direct.h>
@@ -495,7 +495,7 @@ int fnmatch(const char *pattern, const char *string, int flags)
 #include <fnmatch.h>
 #endif
 
-#ifdef WIN32
+#ifdef _WIN32
 /* on windows to query dirs we need foo\* to get files in this directory.
     foo\ always fails and foo will return just info about foo directory,
     not files in this directory */
@@ -520,12 +520,12 @@ FindFileState *find_file_open(const char *path, const char *pattern)
         return NULL;
     strcpy_s(s->path, sizeof(s->path), path);
     strcpy_s(s->dirpath, sizeof(s->path), path);
-#ifdef WIN32
+#ifdef _WIN32
     win_correct_path_for_FindFirstFile(s->path, sizeof(s->path));
 #endif
     strcpy_s(s->pattern, sizeof(s->pattern), pattern);
     s->bufptr = s->path;
-#ifdef WIN32
+#ifdef _WIN32
     s->dir = INVALID_HANDLE_VALUE;
 #else
     s->dir = NULL;
@@ -553,7 +553,7 @@ char *makepath(char *buf, int buf_size, const char *path,
     return buf;
 }
 
-#ifdef WIN32
+#ifdef _WIN32
 static int skip_matching_file(const char *filename)
 {
     if (0 == strcmp(".", filename))
@@ -566,7 +566,7 @@ static int skip_matching_file(const char *filename)
 
 int find_file_next(FindFileState *s, char *filename, int filename_size_max)
 {
-#ifdef WIN32
+#ifdef _WIN32
     int    fFound;
     if (INVALID_HANDLE_VALUE == s->dir) {
         s->dir = FindFirstFile(s->path, &(s->fileinfo));
@@ -633,7 +633,7 @@ CheckFile:
 
 void find_file_close(FindFileState *s)
 {
-#ifdef WIN32
+#ifdef _WIN32
     if (INVALID_HANDLE_VALUE != s->dir)
        FindClose(s->dir);
 #else
@@ -731,7 +731,7 @@ void StrList_Destroy(StrList **root)
     *root = NULL;
 }
 
-#ifndef WIN32
+#ifndef _WIN32
 void OutputDebugString(const char *txt)
 {
     /* do nothing */
@@ -1120,7 +1120,7 @@ Exit:
 }
 #endif
 
-#ifdef WIN32
+#ifdef _WIN32
 #include <sys/types.h>
 #include <sys/stat.h>
 
diff --git a/utils/HtmlOutputDev.h b/utils/HtmlOutputDev.h
index 6dd0327..24ccfd1 100644
--- a/utils/HtmlOutputDev.h
+++ b/utils/HtmlOutputDev.h
@@ -17,6 +17,7 @@
 // Copyright (C) 2006, 2007, 2009 Albert Astals Cid <aacid at kde.org>
 // Copyright (C) 2008-2009 Warren Toomey <wkt at tuhs.org>
 // Copyright (C) 2009 Carlos Garcia Campos <carlosgc at gnome.org>
+// Copyright (C) 2009 Kovid Goyal <kovid at kovidgoyal.net>
 //
 // 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
@@ -42,7 +43,7 @@
 #include "UnicodeMap.h"
 
 
-#ifdef WIN32
+#ifdef _WIN32
 #  define SLASH '\\'
 #else
 #  define SLASH '/'


More information about the poppler mailing list