summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-05-10 09:43:49 +0000
committerrubidium <rubidium@openttd.org>2010-05-10 09:43:49 +0000
commit369dedca896fedf4cc73967f54610a5d96d7e5e6 (patch)
tree5151acbc63394f87af6f5a1fe2ff371c2cb96b1e
parent948beec597f788bc661bf7869d4ab27945215e53 (diff)
downloadopenttd-369dedca896fedf4cc73967f54610a5d96d7e5e6.tar.xz
(svn r19778) -Change: use the value from PATH_MAX (POSIX) for MAX_PATH (Windows/OpenTTD) if it exists
-rw-r--r--src/stdafx.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/stdafx.h b/src/stdafx.h
index 9777e1fa9..8413e1d9d 100644
--- a/src/stdafx.h
+++ b/src/stdafx.h
@@ -416,7 +416,13 @@ void NORETURN CDECL error(const char *str, ...) WARN_FORMAT(1, 2);
#define _stricmp strcasecmp
#endif
-#if !defined(MAX_PATH)
+#if defined(MAX_PATH)
+ /* It's already defined, no need to override */
+#elif defined(PATH_MAX) && PATH_MAX > 0
+ /* Use the value from PATH_MAX, if it exists */
+ #define MAX_PATH PATH_MAX
+#else
+ /* If all else fails, hardcode something :( */
#define MAX_PATH 260
#endif