]> git.sur5r.net Git - bacula/bacula/commitdiff
Added support for wx-console-VC++ (HAVE_WXCONSOLE), and a small correction for MinGW.
authorNicolas Boichat <nicolas@boichat.ch>
Wed, 21 Apr 2004 21:29:43 +0000 (21:29 +0000)
committerNicolas Boichat <nicolas@boichat.ch>
Wed, 21 Apr 2004 21:29:43 +0000 (21:29 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1260 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/win32/compat/compat.cpp
bacula/src/win32/compat/compat.h

index e6c197aed3b94576d3f0787278b6fcf000f33213..e61a3c4072ee95b68d7d5c3b2bf3726c77847891 100644 (file)
@@ -34,9 +34,7 @@
 #define USE_WIN32_COMPAT_IO 1
 
 extern void d_msg(const char *file, int line, int level, const char *fmt,...);
-#ifndef HAVE_MINGW
 extern DWORD   g_platform_id;
-#endif
 
 // from CYGWIN (should be diff between Jan 1 1601 and Jan 1 1970
 #ifdef HAVE_MINGW
@@ -520,7 +518,6 @@ opendir(const char *path)
     char *tspec = (char *)malloc(max_len);
     if (tspec == NULL) goto err1;
 
-#ifndef HAVE_MINGW
     if (g_platform_id != VER_PLATFORM_WIN32_WINDOWS) {
         // allow path to be 32767 bytes
         tspec[0] = '\\';
@@ -532,9 +529,7 @@ opendir(const char *path)
     } else {
         cygwin_conv_to_win32_path(path, tspec);
     }
-#else
-    cygwin_conv_to_win32_path(path, tspec);
-#endif
+
     strncat(tspec, "\\*", max_len);
     rval->spec = tspec;
 
@@ -1154,6 +1149,7 @@ close(int fd)
     return _close(fd);
 }
 
+#ifndef HAVE_WXCONSOLE
 ssize_t
 read(int fd, void *buf, size_t len)
 {
@@ -1165,6 +1161,7 @@ write(int fd, const void *buf, size_t len)
 {
     return _write(fd, buf, len);
 }
+#endif
 
 off_t
 lseek(int fd, off_t offset, int whence)
index 90b1f93ece8d8bdf046e338327a16b0a419523bc..0e6c378dfe361edd8b5213803a73027316a0798d 100644 (file)
 #define __COMPAT_H_
 
 #ifndef HAVE_MINGW
+#ifndef HAVE_WXCONSOLE
 #define __STDC__ 1
 #endif
+#endif
 
 #include <stdio.h>
 #include <basetsd.h>
 #include <stdarg.h>
 #include <sys/types.h>
 
+#ifdef HAVE_WXCONSOLE
+//#include <sys/stat.h>
+#endif
+
 #include <process.h>
 #include <direct.h>
 #include <winsock2.h>
@@ -95,17 +101,21 @@ typedef long time_t;
 #if __STDC__
 #ifndef HAVE_MINGW
 typedef _dev_t dev_t;
+#ifndef HAVE_WXCONSOLE
 typedef __int64 ino_t;
 typedef __int64 off_t;          /* STDC=1 means we can define this */
 #endif
+#endif
 #else
 typedef long _off_t;            /* must be same as sys/types.h */
 #endif
 typedef signed char int8_t;
 #ifndef HAVE_MINGW
+#ifndef HAVE_WXCONSOLE
 typedef int BOOL;
 #define bool BOOL
 #endif
+#endif
 typedef double float64_t;
 typedef UINT32 u_int32_t;
 typedef unsigned char u_int8_t;
@@ -238,8 +248,10 @@ int chmod(const char *, mode_t mode);
 #ifndef HAVE_MINGW
 int utime(const char *filename, struct utimbuf *buf);
 int open(const char *, int, int);
+#ifndef HAVE_WXCONSOLE
 ssize_t read(int fd, void *, size_t nbytes);
 ssize_t write(int fd, const void *, size_t nbytes);
+#endif
 int close(int fd);
 #endif //HAVE_MINGW
 off_t lseek(int, off_t, int);