# arch-tag: automatic-ChangeLog--srvx@srvx.net--2004-srvx/srvx--devo--1.3
#
+2004-04-12 03:25:03 GMT Michael Poole <mdpoole@troilus.org> patch-50
+
+ Summary:
+ fix compile errors on readdir()-deficient platforms
+ Revision:
+ srvx--devo--1.3--patch-50
+
+ * Cygwin does not have "struct dirent.d_type". Check for that in the
+ configure script and use stat() to test for directory-ness instead.
+
+ modified files:
+ ChangeLog configure.in src/helpfile.c
+
+
2004-04-10 23:04:21 GMT Michael Poole <mdpoole@troilus.org> patch-49
Summary:
AC_STRUCT_TM
dnl Would rather not bail on headers, BSD has alot of the functions elsewhere. -Jedi
-AC_CHECK_HEADERS(fcntl.h malloc.h netdb.h netinet/in.h sys/resource.h sys/timeb.h sys/times.h sys/param.h sys/socket.h sys/time.h sys/types.h sys/wait.h unistd.h getopt.h memory.h regex.h arpa/inet.h sys/mman.h sys/stat.h,,)
+AC_CHECK_HEADERS(fcntl.h malloc.h netdb.h netinet/in.h sys/resource.h sys/timeb.h sys/times.h sys/param.h sys/socket.h sys/time.h sys/types.h sys/wait.h unistd.h getopt.h memory.h regex.h arpa/inet.h sys/mman.h sys/stat.h dirent.h,,)
+
+dnl Cygwin does not have d_type in struct dirent. We use stat() as a fallback.
+AC_CHECK_MEMBER([struct dirent.d_type],
+ [AC_DEFINE(HAVE_DIRENT_D_TYPE, 1, [Define if struct dirent exists and includes the d_type element.])],,[#include <dirent.h>])
dnl portability stuff, hurray! -Jedi
AC_CHECK_FUNCS(gettimeofday)
#include "modcmd.h"
#include "nickserv.h"
+#if defined(HAVE_DIRENT_H)
#include <dirent.h>
+#endif
+
+#if defined(HAVE_SYS_STAT_H)
+#include <sys/stat.h>
+#endif
static const struct message_entry msgtab[] = {
{ "HFMSG_MISSING_HELPFILE", "The help file could not be found. Sorry!" },
while ((dirent = readdir(dir))) {
if (dirent->d_name[0] == '.')
continue;
+#ifdef HAVE_DIRENT_D_TYPE
if (dirent->d_type != DT_DIR)
continue;
+#else
+ {
+ char namebuf[MAXLEN];
+ struct stat sbuf;
+ snprintf(namebuf, sizeof(namebuf), "languages/%s", dirent->d_name);
+ if (stat(namebuf, &sbuf) < 0)
+ continue;
+ if (!S_ISDIR(sbuf.st_mode))
+ continue;
+ }
+#endif
language_alloc(dirent->d_name);
}
closedir(dir);