diff options
author | Jonathan Gray | 2004-09-28 04:14:57 +0000 |
---|---|---|
committer | Jonathan Gray | 2004-09-28 04:14:57 +0000 |
commit | ae73d1a4ee373f8c94291dc79f090c991dc021e4 (patch) | |
tree | 586a4882248543f93099d0a8144caa4122a56d4e | |
parent | 7ced14e961d9b79c3efdb6bb6f88942bd2755357 (diff) | |
download | scummvm-rg350-ae73d1a4ee373f8c94291dc79f090c991dc021e4.tar.gz scummvm-rg350-ae73d1a4ee373f8c94291dc79f090c991dc021e4.tar.bz2 scummvm-rg350-ae73d1a4ee373f8c94291dc79f090c991dc021e4.zip |
use MAXPATHLEN for path buffer size
svn-id: r15319
-rw-r--r-- | common/stdafx.h | 1 | ||||
-rw-r--r-- | common/util.h | 4 | ||||
-rw-r--r-- | gui/options.cpp | 5 |
3 files changed, 9 insertions, 1 deletions
diff --git a/common/stdafx.h b/common/stdafx.h index 2d59efe688..9a72493129 100644 --- a/common/stdafx.h +++ b/common/stdafx.h @@ -97,6 +97,7 @@ #undef CMD_INVALID #endif #if !defined(macintosh) +#include <sys/param.h> #include <sys/types.h> #include <sys/uio.h> #endif diff --git a/common/util.h b/common/util.h index 68c47a1fb5..0df4e54a59 100644 --- a/common/util.h +++ b/common/util.h @@ -24,8 +24,12 @@ #include "common/scummsys.h" 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; } +#endif +#if !defined(MAX) 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. diff --git a/gui/options.cpp b/gui/options.cpp index f26ba209c8..6cd4b8d461 100644 --- a/gui/options.cpp +++ b/gui/options.cpp @@ -427,7 +427,10 @@ void GlobalOptionsDialog::open() { _savePath->setLabel(dir); } else { // Default to the current directory... - char buf[256]; +#if !(defined(MAXPATHLEN)) +#define MAXPATHLEN 1024 +#endif + char buf[MAXPATHLEN]; getcwd(buf, sizeof(buf)); _savePath->setLabel(buf); } |