summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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