use MAXPATHLEN for path buffer size

svn-id: r15319
This commit is contained in:
Jonathan Gray 2004-09-28 04:14:57 +00:00
parent 7ced14e961
commit ae73d1a4ee
3 changed files with 9 additions and 1 deletions

View file

@ -97,6 +97,7 @@
#undef CMD_INVALID #undef CMD_INVALID
#endif #endif
#if !defined(macintosh) #if !defined(macintosh)
#include <sys/param.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/uio.h> #include <sys/uio.h>
#endif #endif

View file

@ -24,8 +24,12 @@
#include "common/scummsys.h" #include "common/scummsys.h"
template<typename T> inline T ABS (T x) { return (x>=0) ? x : -x; } template<typename T> inline T ABS (T x) { return (x>=0) ? x : -x; }
#if !defined(MIN)
template<typename T> inline T MIN (T a, T b) { return (a<b) ? a : b; } template<typename T> inline T MIN (T a, T b) { return (a<b) ? a : b; }
#endif
#if !defined(MAX)
template<typename T> inline T MAX (T a, T b) { return (a>b) ? a : b; } template<typename T> inline T MAX (T a, T b) { return (a>b) ? a : b; }
#endif
/** /**
* Template method which swaps the vaulues of its two parameters. * Template method which swaps the vaulues of its two parameters.

View file

@ -427,7 +427,10 @@ void GlobalOptionsDialog::open() {
_savePath->setLabel(dir); _savePath->setLabel(dir);
} else { } else {
// Default to the current directory... // Default to the current directory...
char buf[256]; #if !(defined(MAXPATHLEN))
#define MAXPATHLEN 1024
#endif
char buf[MAXPATHLEN];
getcwd(buf, sizeof(buf)); getcwd(buf, sizeof(buf));
_savePath->setLabel(buf); _savePath->setLabel(buf);
} }