diff --git a/goo/GooMutex.h b/goo/GooMutex.h index f78a14b..6b46fad 100644 --- a/goo/GooMutex.h +++ b/goo/GooMutex.h @@ -22,7 +22,7 @@ // ... // gDestroyMutex(&m); -#ifdef WIN32 +#ifdef _WIN32 #include diff --git a/goo/gfile.cc b/goo/gfile.cc index e95e52c..be46eb7 100644 --- a/goo/gfile.cc +++ b/goo/gfile.cc @@ -28,7 +28,7 @@ #include -#ifdef WIN32 +#ifdef _WIN32 # include #else # if defined(MACOS) @@ -46,7 +46,7 @@ # if defined(VMS) && (__DECCXX_VER < 50200000) # include # endif -#endif // WIN32 +#endif // _WIN32 #include "GooString.h" #include "gfile.h" @@ -63,7 +63,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 +109,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 +163,7 @@ GooString *appendToPath(GooString *path, char *fileName) { } return path; -#elif defined(WIN32) +#elif defined(_WIN32) //---------- Win32 ---------- GooString *tmp; char buf[256]; @@ -299,7 +299,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 +343,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 +373,7 @@ GooString *makePathAbsolute(GooString *path) { } return path; -#elif defined(WIN32) +#elif defined(_WIN32) //---------- Win32 ---------- char buf[_MAX_PATH]; char *fp; @@ -444,7 +444,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 +458,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 +585,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 +603,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 +622,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 +641,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 +657,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 +701,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..11d9e21 100644 --- a/goo/gfile.h +++ b/goo/gfile.h @@ -30,7 +30,7 @@ #include #include extern "C" { -#if defined(WIN32) +#if defined(_WIN32) # include # ifdef FPTEX # include @@ -141,7 +141,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..7a9c56f 100644 --- a/poppler/ABWOutputDev.h +++ b/poppler/ABWOutputDev.h @@ -27,7 +27,7 @@ #include #include -#ifdef WIN32 +#ifdef _WIN32 # define SLASH '\\' #else # define SLASH '/' diff --git a/poppler/FileSpec.cc b/poppler/FileSpec.cc index a788cd8..d9794e6 100644 --- a/poppler/FileSpec.cc +++ b/poppler/FileSpec.cc @@ -73,7 +73,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 +91,7 @@ GBool getFileSpecNameForPlatform (Object *fileSpec, Object *fileName) } // system-dependent path manipulation -#ifdef WIN32 +#ifdef _WIN32 int i, j; GooString *name = fileName->getString(); // "//...." --> "\...." @@ -133,7 +133,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..0ed34ab 100644 --- a/poppler/GlobalParams.cc +++ b/poppler/GlobalParams.cc @@ -37,11 +37,11 @@ #include #include #ifdef ENABLE_PLUGINS -# ifndef WIN32 +# ifndef _WIN32 # include # endif #endif -#ifdef WIN32 +#ifdef _WIN32 # include #endif #include "goo/gmem.h" @@ -62,7 +62,7 @@ #include "GlobalParams.h" #include "GfxFont.h" -#ifdef WIN32 +#ifdef _WIN32 # define strcasecmp stricmp #endif @@ -91,7 +91,7 @@ #include "UTF8.h" #ifdef ENABLE_PLUGINS -# ifdef WIN32 +# ifdef _WIN32 extern XpdfPluginVecTable xpdfPluginVecTable; # endif #endif @@ -139,7 +139,7 @@ DisplayFontParam::~DisplayFontParam() { } } -#ifdef WIN32 +#ifdef _WIN32 //------------------------------------------------------------------------ // WinFontInfo @@ -382,7 +382,7 @@ int CALLBACK WinFontList::enumFunc2(CONST LOGFONT *font, return 1; } -#endif // WIN32 +#endif // _WIN32 //------------------------------------------------------------------------ // PSFontParam @@ -417,7 +417,7 @@ public: private: -#ifdef WIN32 +#ifdef _WIN32 Plugin(HMODULE libA); HMODULE lib; #else @@ -431,7 +431,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 +442,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 +476,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 +497,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 +507,7 @@ Plugin *Plugin::load(char *type, char *name) { return plugin; err2: -#ifdef WIN32 +#ifdef _WIN32 FreeLibrary(libA); #else dlclose(dlA); @@ -517,7 +517,7 @@ Plugin *Plugin::load(char *type, char *name) { return NULL; } -#ifdef WIN32 +#ifdef _WIN32 Plugin::Plugin(HMODULE libA) { lib = libA; } @@ -530,7 +530,7 @@ Plugin::Plugin(void *dlA) { Plugin::~Plugin() { void (*xpdfFreePlugin)(void); -#ifdef WIN32 +#ifdef _WIN32 if ((xpdfFreePlugin = (void (*)(void)) GetProcAddress(lib, "xpdfFreePlugin"))) { (*xpdfFreePlugin)(); @@ -578,7 +578,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 +608,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 +641,7 @@ GlobalParams::GlobalParams(const char *customPopplerDataDir) unicodeMapCache = new UnicodeMapCache(); cMapCache = new CMapCache(); -#ifdef WIN32 +#ifdef _WIN32 baseFontsInitialized = gFalse; winFontList = NULL; #endif @@ -806,7 +806,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..9348a11 100644 --- a/poppler/Link.cc +++ b/poppler/Link.cc @@ -476,7 +476,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 4279b33..a793516 100644 --- a/poppler/PDFDoc.cc +++ b/poppler/PDFDoc.cc @@ -39,7 +39,7 @@ #include #include #include -#ifdef WIN32 +#ifdef _WIN32 # include #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..e83667b 100644 --- a/poppler/PDFDoc.h +++ b/poppler/PDFDoc.h @@ -63,7 +63,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..c319a2f 100644 --- a/poppler/PSOutputDev.cc +++ b/poppler/PSOutputDev.cc @@ -1008,7 +1008,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 +1219,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..89eca53 100644 --- a/poppler/TextOutputDev.cc +++ b/poppler/TextOutputDev.cc @@ -38,7 +38,7 @@ #include #include #include -#ifdef WIN32 +#ifdef _WIN32 #include // for O_BINARY #include // for setmode #endif @@ -4631,7 +4631,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..ad9c156 100644 --- a/poppler/XpdfPluginAPI.cc +++ b/poppler/XpdfPluginAPI.cc @@ -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 --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..12f99bb 100644 --- a/splash/SplashFontEngine.cc +++ b/splash/SplashFontEngine.cc @@ -144,7 +144,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 +173,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 +218,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 +270,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 #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 #include #include @@ -495,7 +495,7 @@ int fnmatch(const char *pattern, const char *string, int flags) #include #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 #include diff --git a/utils/HtmlOutputDev.h b/utils/HtmlOutputDev.h index 6dd0327..2753ee4 100644 --- a/utils/HtmlOutputDev.h +++ b/utils/HtmlOutputDev.h @@ -42,7 +42,7 @@ #include "UnicodeMap.h" -#ifdef WIN32 +#ifdef _WIN32 # define SLASH '\\' #else # define SLASH '/'