From: Nicolas Boichat Date: Wed, 21 Apr 2004 21:29:43 +0000 (+0000) Subject: Added support for wx-console-VC++ (HAVE_WXCONSOLE), and a small correction for MinGW. X-Git-Tag: Release-1.34.3~139 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=18db184085f22c779e6d5b7c72f71daf424a619d;p=bacula%2Fbacula Added support for wx-console-VC++ (HAVE_WXCONSOLE), and a small correction for MinGW. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1260 91ce42f0-d328-0410-95d8-f526ca767f89 --- diff --git a/bacula/src/win32/compat/compat.cpp b/bacula/src/win32/compat/compat.cpp index e6c197aed3..e61a3c4072 100644 --- a/bacula/src/win32/compat/compat.cpp +++ b/bacula/src/win32/compat/compat.cpp @@ -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) diff --git a/bacula/src/win32/compat/compat.h b/bacula/src/win32/compat/compat.h index 90b1f93ece..0e6c378dfe 100644 --- a/bacula/src/win32/compat/compat.h +++ b/bacula/src/win32/compat/compat.h @@ -35,14 +35,20 @@ #define __COMPAT_H_ #ifndef HAVE_MINGW +#ifndef HAVE_WXCONSOLE #define __STDC__ 1 #endif +#endif #include #include #include #include +#ifdef HAVE_WXCONSOLE +//#include +#endif + #include #include #include @@ -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);