Commit 091f68cc authored by Kovid Goyal's avatar Kovid Goyal Committed by Albert Astals Cid

Use _WIN32 instead of WIN32

More info at http://bugs.freedesktop.org/show_bug.cgi?id=24259
parent 7fd8bdfa
......@@ -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@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>
......
......@@ -20,6 +20,7 @@
// Copyright (C) 2008 Adam Batkin <adam@batkin.net>
// Copyright (C) 2008 Hib Eris <hib@hiberis.nl>
// Copyright (C) 2009 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2009 Kovid Goyal <kovid@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)
......
......@@ -17,6 +17,7 @@
//
// Copyright (C) 2006 Kristian Høgsberg <krh@redhat.com>
// Copyright (C) 2009 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2009 Kovid Goyal <kovid@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)
......
......@@ -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"
......
......@@ -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"
......
......@@ -3,6 +3,7 @@
// ABWOutputDev.h
//
// Copyright 2006-2007 Jauco Noordzij <jauco@jauco.nl>
// Copyright (C) 2009 Kovid Goyal <kovid@kovidgoyal.net>
//
//========================================================================
......@@ -27,7 +28,7 @@
#include <libxml/xpath.h>
#include <libxml/xpathInternals.h>
#ifdef WIN32
#ifdef _WIN32
# define SLASH '\\'
#else
# define SLASH '/'
......
......@@ -6,6 +6,7 @@
// under GPL version 2 or later
//
// Copyright (C) 2008-2009 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2009 Kovid Goyal <kovid@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;
}
......@@ -21,6 +21,7 @@
// Copyright (C) 2007, 2009 Jonathan Kew <jonathan_kew@sil.org>
// Copyright (C) 2009 Petr Gajdos <pgajdos@novell.com>
// Copyright (C) 2009 William Bader <williambader@hotmail.com>
// Copyright (C) 2009 Kovid Goyal <kovid@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);
......
......@@ -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
......
......@@ -17,6 +17,7 @@
// Copyright (C) 2007 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2008 Hugo Mercier <hmercier31@gmail.com>
// Copyright (C) 2008, 2009 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2009 Kovid Goyal <kovid@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)) {
......
......@@ -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;
......
......@@ -19,6 +19,7 @@
// Copyright (C) 2008 Pino Toscano <pino@kde.org>
// Copyright (C) 2008 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2009 Eric Toombs <ewtoombs@uwaterloo.ca>
// Copyright (C) 2009 Kovid Goyal <kovid@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
......
......@@ -24,6 +24,7 @@
// Copyright (C) 2009 Till Kamppeter <till.kamppeter@gmail.com>
// Copyright (C) 2009 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2009 William Bader <williambader@hotmail.com>
// Copyright (C) 2009 Kovid Goyal <kovid@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
}
......
......@@ -21,6 +21,7 @@
// Copyright (C) 2008 Pino Toscano <pino@kde.org>
// Copyright (C) 2008 Hib Eris <hib@hiberis.nl>
// Copyright (C) 2009 Ross Moore <ross@maths.mq.edu.au>
// Copyright (C) 2009 Kovid Goyal <kovid@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
......
......@@ -6,6 +6,17 @@
//
//========================================================================
//========================================================================
//
// Modified under the Poppler project - http://poppler.freedesktop.org
//
// Copyright (C) 2009 Kovid Goyal <kovid@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"
......
......@@ -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"
......
......@@ -13,6 +13,7 @@
//
// Copyright (C) 2006 Takashi Iwai <tiwai@suse.de>
// Copyright (C) 2009 Petr Gajdos <pgajdos@novell.com>
// Copyright (C) 2009 Kovid Goyal <kovid@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
......
......@@ -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>
......
......@@ -17,6 +17,7 @@
// Copyright (C) 2006, 2007, 2009 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2008-2009 Warren Toomey <wkt@tuhs.org>
// Copyright (C) 2009 Carlos Garcia Campos <carlosgc@gnome.org>
// Copyright (C) 2009 Kovid Goyal <kovid@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 '/'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment