From c0328e132864543bba20ffc00e41277b756a408c Mon Sep 17 00:00:00 2001 From: Ben Kaduk Date: Fri, 14 Jun 2013 13:31:42 -0400 Subject: [PATCH] Always provide a usable PATH_MAX If a program does not include limits.h (or includes it after roken.h), it can end up with PATH_MAX defined to be MAX_PATH, but MAX_PATH undefined. This causes consumers of PATH_MAX to become unhappy. Work around this case by only using MAX_PATH if it is available, and a constant otherwise. --- lib/roken/roken-common.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/roken/roken-common.h b/lib/roken/roken-common.h index 02122be49..06106d0d5 100644 --- a/lib/roken/roken-common.h +++ b/lib/roken/roken-common.h @@ -151,7 +151,11 @@ #endif /* !_WIN32 */ #ifndef PATH_MAX +#ifdef MAX_PATH #define PATH_MAX MAX_PATH +#else +#define PATH_MAX 4096 +#endif #endif #ifndef RETSIGTYPE