Hi,
Attached are a few patch that fixes glob and glthread/cond modules
compilation problem under MinGW.
Additionally, a third patch fixes a licensing problem with the fnmatch
module: fnmatch license was changed to LGPLv2+, but the fnmatch-posix
and fnmatch-gnu associated modules are still GPL.
Regards,
--
Yoann Vandoorselaere <[EMAIL PROTECTED]>
diff --git a/lib/glob.c b/lib/glob.c
index 24aec87..5139a90 100644
--- a/lib/glob.c
+++ b/lib/glob.c
@@ -43,7 +43,9 @@
# define POSIX
#endif
-#include <pwd.h>
+#ifndef WIN32
+# include <pwd.h>
+#endif
#include <errno.h>
#ifndef __set_errno
@@ -81,7 +83,7 @@
/* If the system has the `struct dirent64' type we use it internally. */
#if defined _LIBC && !defined COMPILE_GLOB64
-# if (defined POSIX || defined WINDOWS32) && !defined __GNU_LIBRARY__
+# if (defined POSIX || defined WIN32) && !defined __GNU_LIBRARY__
# define CONVERT_D_INO(d64, d32)
# else
# define CONVERT_D_INO(d64, d32) \
@@ -102,7 +104,7 @@
#endif
-#if (defined POSIX || defined WINDOWS32) && !defined __GNU_LIBRARY__
+#if (defined POSIX || defined WIN32) && !defined __GNU_LIBRARY__
/* Posix does not require that the d_ino field be present, and some
systems do not provide it. */
# define REAL_DIR_ENTRY(dp) 1
@@ -423,14 +425,14 @@ glob (pattern, flags, errfunc, pglob)
/* Find the filename. */
filename = strrchr (pattern, '/');
-#if defined __MSDOS__ || defined WINDOWS32
+#if defined __MSDOS__ || defined WIN32
/* The case of "d:pattern". Since `:' is not allowed in
file names, we can safely assume that wherever it
happens in pattern, it signals the filename part. This
is so we could some day support patterns like "[a-z]:foo". */
if (filename == NULL)
filename = strchr (pattern, ':');
-#endif /* __MSDOS__ || WINDOWS32 */
+#endif /* __MSDOS__ || WIN32 */
dirname_modified = 0;
if (filename == NULL)
{
@@ -470,7 +472,7 @@ glob (pattern, flags, errfunc, pglob)
{
char *newp;
dirlen = filename - pattern;
-#if defined __MSDOS__ || defined WINDOWS32
+#if defined __MSDOS__ || defined WIN32
if (*filename == ':'
|| (filename > pattern + 1 && filename[-1] == ':'))
{
@@ -494,7 +496,7 @@ glob (pattern, flags, errfunc, pglob)
++filename;
if (filename[0] == '\0'
-#if defined __MSDOS__ || defined WINDOWS32
+#if defined __MSDOS__ || defined WIN32
&& dirname[dirlen - 1] != ':'
&& (dirlen < 3 || dirname[dirlen - 2] != ':'
|| dirname[dirlen - 1] != '/')
@@ -564,7 +566,7 @@ glob (pattern, flags, errfunc, pglob)
if (home_dir == NULL || home_dir[0] == '\0')
home_dir = "SYS:";
# else
-# ifdef WINDOWS32
+# ifdef WIN32
if (home_dir == NULL || home_dir[0] == '\0')
home_dir = "c:/users/default"; /* poor default */
# else
@@ -629,7 +631,7 @@ glob (pattern, flags, errfunc, pglob)
else
home_dir = "~"; /* No luck. */
}
-# endif /* WINDOWS32 */
+# endif /* WIN32 */
# endif
/* Now construct the full directory. */
if (dirname[1] == '\0')
@@ -649,7 +651,7 @@ glob (pattern, flags, errfunc, pglob)
}
dirname_modified = 1;
}
-# if !defined _AMIGA && !defined WINDOWS32
+# if !defined _AMIGA && !defined WIN32
else
{
char *end_name = strchr (dirname, '/');
@@ -765,7 +767,7 @@ glob (pattern, flags, errfunc, pglob)
home directory. */
return GLOB_NOMATCH;
}
-# endif /* Not Amiga && not WINDOWS32. */
+# endif /* Not Amiga && not WIN32. */
}
/* Now test whether we looked for "~" or "~NAME". In this case we
@@ -1113,7 +1115,7 @@ prefix_array (const char *dirname, char **array, size_t n)
{
register size_t i;
size_t dirlen = strlen (dirname);
-#if defined __MSDOS__ || defined WINDOWS32
+#if defined __MSDOS__ || defined WIN32
int sep_char = '/';
# define DIRSEP_CHAR sep_char
#else
@@ -1124,7 +1126,7 @@ prefix_array (const char *dirname, char **array, size_t n)
/* DIRNAME is just "/", so normal prepending would get us "//foo".
We want "/foo" instead, so don't prepend any chars from DIRNAME. */
dirlen = 0;
-#if defined __MSDOS__ || defined WINDOWS32
+#if defined __MSDOS__ || defined WIN32
else if (dirlen > 1)
{
if (dirname[dirlen - 1] == '/' && dirname[dirlen - 2] == ':')
diff --git a/lib/glthread/cond.h b/lib/glthread/cond.h
index f71e627..a9fc699 100644
--- a/lib/glthread/cond.h
+++ b/lib/glthread/cond.h
@@ -269,7 +269,7 @@ typedef pthread_cond_t gl_cond_t;
/* ========================================================================= */
-#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS || USE_WIN32_THREADS)
+#if !(USE_POSIX_THREADS || USE_PTH_THREADS || USE_SOLARIS_THREADS)
/* Provide dummy implementation if threads are not supported. */
@@ -285,6 +285,10 @@ typedef int gl_cond_t;
#endif
+#if USE_WIN32_THREADS
+# define ETIMEDOUT WSAETIMEDOUT
+#endif
+
/* ========================================================================= */
/* Macros with built-in error handling. */
diff --git a/modules/fnmatch-gnu b/modules/fnmatch-gnu
index 3328d23..143344e 100644
--- a/modules/fnmatch-gnu
+++ b/modules/fnmatch-gnu
@@ -15,7 +15,7 @@ Include:
"fnmatch.h"
License:
-GPL
+LGPLv2+
Maintainer:
all
diff --git a/modules/fnmatch-posix b/modules/fnmatch-posix
index bd4c6f5..c439b23 100644
--- a/modules/fnmatch-posix
+++ b/modules/fnmatch-posix
@@ -15,7 +15,7 @@ Include:
"fnmatch.h"
License:
-GPL
+LGPLv2+
Maintainer:
all