changeset 13012:98d47593c330

scandir: Fix link error on Solaris 8.
author Bruno Haible <bruno@clisp.org>
date Sat, 20 Mar 2010 00:20:36 +0100
parents 37630f6e084b
children 91cd971b278e
files ChangeLog lib/scandir.c
diffstat 2 files changed, 13 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2010-03-19  Bruno Haible  <bruno@clisp.org>
+
+	scandir: Fix link error on Solaris 8.
+	* lib/scandir.c (_D_EXACT_NAMLEN, _D_ALLOC_NAMLEN): New fallback
+	macros.
+
 2010-03-19  Bruno Haible  <bruno@clisp.org>
 
 	getusershell: Fix documentation.
--- a/lib/scandir.c
+++ b/lib/scandir.c
@@ -33,6 +33,13 @@
 
 #undef select
 
+#ifndef _D_EXACT_NAMLEN
+# define _D_EXACT_NAMLEN(d) strlen ((d)->d_name)
+#endif
+#ifndef _D_ALLOC_NAMLEN
+# define _D_ALLOC_NAMLEN(d) (_D_EXACT_NAMLEN (d) + 1)
+#endif
+
 #if _LIBC
 # ifndef SCANDIR
 #  define SCANDIR scandir