diff options
-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); } |