Tweaks to compile with mingw32 unlabeled-3.1.122
authorcls%seawood.org
Fri, 23 Jul 1999 16:28:55 +0000
branchunlabeled-3.1.122
changeset 151 d2761f718be18f2193f52c52f4087e39dd3c998e
parent 11 a73f46edfca2aa2629638f7952d04b0b4415346c
child 13943 29edd0ed0c9973cdb1341ac481618895754cd23f
push idunknown
push userunknown
push dateunknown
Tweaks to compile with mingw32
dbm/include/winfile.h
--- a/dbm/include/winfile.h
+++ b/dbm/include/winfile.h
@@ -7,27 +7,32 @@
 #define WINFILE_H
 
 #ifdef _WINDOWS
 /* hacked out of <dirent.h> on an SGI */
 #if defined(XP_WIN32) || defined(_WIN32)
 /* 32-bit stuff here */
 #include <windows.h>
 #include <stdlib.h>
+#if defined(__GNUC__)
+#include <sys/types.h>
+#include <sys/stat.h>
+#else
 #include <sys\types.h>
 #include <sys\stat.h>
+#endif
 
 typedef struct DIR_Struct {
     void            * directoryPtr;
     WIN32_FIND_DATA   data;
 } DIR;
 
 #define _ST_FSTYPSZ 16
 
-#ifndef __BORLANDC__
+#if !defined(__BORLANDC__) && !defined(__GNUC__)
  typedef unsigned long mode_t;
  typedef          long uid_t;
  typedef          long gid_t;
  typedef          long off_t;
  typedef unsigned long nlink_t;
 #endif 
 
 typedef struct timestruc {
@@ -38,17 +43,17 @@ typedef struct timestruc {
 
 struct dirent {                                 /* data from readdir() */
         ino_t           d_ino;                  /* inode number of entry */
         off_t           d_off;                  /* offset of disk direntory entry */
         unsigned short  d_reclen;               /* length of this record */
         char            d_name[_MAX_FNAME];     /* name of file */
 };
 
-#ifndef __BORLANDC__
+#if defined(__BORLANDC__) && !defined(__GNUC__)
 #define S_ISDIR(s)  ((s) & _S_IFDIR)
 #endif
 
 #else /* _WIN32 */
 /* 16-bit windows stuff */
 
 #include <sys\types.h>
 #include <sys\stat.h>