From 369dedca896fedf4cc73967f54610a5d96d7e5e6 Mon Sep 17 00:00:00 2001 From: rubidium Date: Mon, 10 May 2010 09:43:49 +0000 Subject: (svn r19778) -Change: use the value from PATH_MAX (POSIX) for MAX_PATH (Windows/OpenTTD) if it exists --- src/stdafx.h | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src') 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 -- cgit v1.2.3-54-g00ecf