src/nnn.c | 15 ++++++++++++--- diff --git a/src/nnn.c b/src/nnn.c index 851293aa14662be4a7c54acba124442134bb4cc0..407616c29f176140c34afc8c736b87e16cb73fba 100644 --- a/src/nnn.c +++ b/src/nnn.c @@ -74,9 +74,6 @@ #include #include #include #include -#ifdef __gnu_hurd__ -#define PATH_MAX 4096 -#endif #ifndef NOLOCALE #include #endif @@ -116,6 +113,18 @@ #define SESSIONS_VERSION 1 #ifndef S_BLKSIZE #define S_BLKSIZE 512 /* S_BLKSIZE is missing on Android NDK (Termux) */ +#endif + +/* + * NAME_MAX and PATH_MAX may not exist, e.g. with dirent.c_name being a + * flexible array on Illumos. Use somewhat accomodating fallback values. + */ +#ifndef NAME_MAX +#define NAME_MAX 255 +#endif + +#ifndef PATH_MAX +#define PATH_MAX 4096 #endif #define _ABSSUB(N, M) (((N) <= (M)) ? ((M) - (N)) : ((N) - (M)))