From 0602ef256c9d76dee64345f3f780f9a3a40e1775 Mon Sep 17 00:00:00 2001 From: Hib Eris Date: Fri, 2 Jul 2010 14:45:15 +0200 Subject: [PATCH 4/7] [win32] Use MAX_PATH instead of _MAX_PATH everywhere _MAX_PATH is compiler specific and not availble with the mingw compiler in ansi mode. MAX_PATH is in the Windows api and thus always available when windows.h is included. --- goo/gfile.cc | 4 ++-- poppler/GlobalParams.cc | 2 +- poppler/PDFDoc.cc | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/goo/gfile.cc b/goo/gfile.cc index e875630..ff23aae 100644 --- a/goo/gfile.cc +++ b/goo/gfile.cc @@ -376,11 +376,11 @@ GooString *makePathAbsolute(GooString *path) { #elif defined(_WIN32) //---------- Win32 ---------- - char buf[_MAX_PATH]; + char buf[MAX_PATH]; char *fp; buf[0] = '\0'; - if (!GetFullPathName(path->getCString(), _MAX_PATH, buf, &fp)) { + if (!GetFullPathName(path->getCString(), MAX_PATH, buf, &fp)) { path->clear(); return path; } diff --git a/poppler/GlobalParams.cc b/poppler/GlobalParams.cc index 293d7f3..473eab7 100644 --- a/poppler/GlobalParams.cc +++ b/poppler/GlobalParams.cc @@ -172,7 +172,7 @@ DllMain (HINSTANCE hinstDLL, static char * get_poppler_datadir (void) { - static char retval[_MAX_PATH]; + static char retval[MAX_PATH]; static int beenhere = 0; unsigned char *p; diff --git a/poppler/PDFDoc.cc b/poppler/PDFDoc.cc index b650480..ade5fe4 100644 --- a/poppler/PDFDoc.cc +++ b/poppler/PDFDoc.cc @@ -131,7 +131,7 @@ PDFDoc::PDFDoc(GooString *fileNameA, GooString *ownerPassword, PDFDoc::PDFDoc(wchar_t *fileNameA, int fileNameLen, GooString *ownerPassword, GooString *userPassword, void *guiDataA) { OSVERSIONINFO version; - wchar_t fileName2[_MAX_PATH + 1]; + wchar_t fileName2[MAX_PATH + 1]; Object obj; int i; @@ -146,7 +146,7 @@ PDFDoc::PDFDoc(wchar_t *fileNameA, int fileNameLen, GooString *ownerPassword, } // zero-terminate the file name string - for (i = 0; i < fileNameLen && i < _MAX_PATH; ++i) { + for (i = 0; i < fileNameLen && i < MAX_PATH; ++i) { fileName2[i] = fileNameA[i]; } fileName2[i] = 0; -- 1.6.4.2