diff --git a/tools/mkdeps.c b/tools/mkdeps.c index 003b1234b5..1b8989e87c 100644 --- a/tools/mkdeps.c +++ b/tools/mkdeps.c @@ -54,8 +54,28 @@ #define MAX_BUFFER (4096) -#ifdef WIN32 -# define NAME_MAX FILENAME_MAX +/* NAME_MAX is typically defined in limits.h */ + +#if !defined(NAME_MAX) + + /* FILENAME_MAX might be defined in stdio.h */ + +# if defined(FILENAME_MAX) +# define NAME_MAX FILENAME_MAX +# else + + /* MAXNAMELEN might be defined in dirent.h */ + +# include +# if defined(MAXNAMLEN) +# define NAME_MAX MAXNAMLEN +# else + + /* Lets not let a silly think like this stop us... just make something up */ + +# define NAME_MAX 256 +# endif +# endif #endif /****************************************************************************