summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Nutt <gnutt@nuttx.org>2014-07-04 07:22:36 -0600
committerGregory Nutt <gnutt@nuttx.org>2014-07-04 07:22:36 -0600
commitf3d89a7cb7d702da8aaeee6afbcdffac236fb976 (patch)
tree17d610e3c6a63b522d707353188b82e547fc4fab
parent3f6202fa63164adb8c8398474b92d113a9bacef7 (diff)
downloadnuttx-f3d89a7cb7d702da8aaeee6afbcdffac236fb976.tar.gz
nuttx-f3d89a7cb7d702da8aaeee6afbcdffac236fb976.tar.bz2
nuttx-f3d89a7cb7d702da8aaeee6afbcdffac236fb976.zip
NAME_MAX not available on SunOS
-rw-r--r--nuttx/tools/mkdeps.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/nuttx/tools/mkdeps.c b/nuttx/tools/mkdeps.c
index 003b1234b..1b8989e87 100644
--- a/nuttx/tools/mkdeps.c
+++ b/nuttx/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 <dirent.h>
+# 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
/****************************************************************************