Win32 hacks from <Rob_Tulloh@tivoli.com>.
* posix/glob.c [WIN32]: Don't include <pwd.h>; don't use d_ino;
use void * for my_realloc; include <malloc.h> for alloca.
(glob) [WIN32]: Use "c:/users/default" for ~ if no HOME variable.
* posix/fnmatch.h [WIN32]: Use prototypes even if [!__STDC__].
* posix/glob.h: Likewise.
-#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
+#if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \
+ || defined (WIN32))
#undef __P
#define __P(protos) protos
#else /* Not C++ or ANSI C. */
#undef __P
#define __P(protos) protos
#else /* Not C++ or ANSI C. */
-#if !defined (_AMIGA) && !defined (VMS)
+#if !defined (_AMIGA) && !defined (VMS) && !defined(WIN32)
-#if defined (POSIX) && !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
/* Posix does not require that the d_ino field be present, and some
systems do not provide it. */
#define REAL_DIR_ENTRY(dp) 1
__inline
#endif
#ifndef __SASC
__inline
#endif
#ifndef __SASC
+#ifdef WIN32
+static void *
+#else
my_realloc (p, n)
char *p;
unsigned int n;
my_realloc (p, n)
char *p;
unsigned int n;
#include <alloca.h>
#else /* Not HAVE_ALLOCA_H. */
#ifndef _AIX
#include <alloca.h>
#else /* Not HAVE_ALLOCA_H. */
#ifndef _AIX
+#ifdef WIN32
+#include <malloc.h>
+#else
#endif /* Not _AIX. */
#endif /* sparc or HAVE_ALLOCA_H. */
#endif /* GCC. */
#endif /* Not _AIX. */
#endif /* sparc or HAVE_ALLOCA_H. */
#endif /* GCC. */
if (dirname == NULL || dirname[0] == '\0')
dirname = "SYS:";
#else
if (dirname == NULL || dirname[0] == '\0')
dirname = "SYS:";
#else
+#ifdef WIN32
+ if (dirname == NULL || dirname[0] == '\0')
+ dirname = "c:/users/default"; /* poor default */
+#else
if (dirname == NULL || dirname[0] == '\0')
{
extern char *getlogin __P ((void));
if (dirname == NULL || dirname[0] == '\0')
{
extern char *getlogin __P ((void));
}
if (dirname == NULL || dirname[0] == '\0')
dirname = (char *) "~"; /* No luck. */
}
if (dirname == NULL || dirname[0] == '\0')
dirname = (char *) "~"; /* No luck. */
if (dirname == NULL || dirname[0] == '\0')
dirname = "SYS:";
#else
if (dirname == NULL || dirname[0] == '\0')
dirname = "SYS:";
#else
+#ifdef WIN32
+ if (dirname == NULL || dirname[0] == '\0')
+ dirname = "c:/users/default"; /* poor default */
+#else
/* Look up specific user's home directory. */
struct passwd *p = getpwnam (dirname + 1);
if (p != NULL)
dirname = p->pw_dir;
/* Look up specific user's home directory. */
struct passwd *p = getpwnam (dirname + 1);
if (p != NULL)
dirname = p->pw_dir;
-#if defined (__cplusplus) || (defined (__STDC__) && __STDC__)
+#if (defined (__cplusplus) || (defined (__STDC__) && __STDC__) \
+ || defined (WIN32))
#undef __P
#define __P(protos) protos
#define __ptr_t void *
#undef __P
#define __P(protos) protos
#define __ptr_t void *