From 55d5ff7393c5a4c65483cf5573d7b38ca6e99bd7 Mon Sep 17 00:00:00 2001 From: "Christopher S. Hull" Date: Tue, 24 Feb 2004 18:13:14 +0000 Subject: [PATCH] add __STDC__=1 for all windows includes and fixup resulting namespace changes. use 64bit off_t and switch lseek() to call _lseeki64() for 64bit file addressing git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1085 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/win32/compat/compat.cpp | 6 +++--- bacula/src/win32/compat/compat.h | 33 +++++++++++++++++++++++------- 2 files changed, 29 insertions(+), 10 deletions(-) diff --git a/bacula/src/win32/compat/compat.cpp b/bacula/src/win32/compat/compat.cpp index c474e16df3..f90315972d 100644 --- a/bacula/src/win32/compat/compat.cpp +++ b/bacula/src/win32/compat/compat.cpp @@ -22,8 +22,8 @@ // Author : Christopher S. Hull // Created On : Sat Jan 31 15:55:00 2004 // Last Modified By: Christopher S. Hull -// Last Modified On: Mon Feb 23 10:48:23 2004 -// Update Count : 663 +// Last Modified On: Tue Feb 24 11:01:09 2004 +// Update Count : 664 // $Id$ #include @@ -1145,7 +1145,7 @@ write(int fd, const void *buf, size_t len) off_t lseek(int fd, off_t offset, int whence) { - return _lseek(fd, offset, whence); + return _lseeki64(fd, offset, whence); } int diff --git a/bacula/src/win32/compat/compat.h b/bacula/src/win32/compat/compat.h index 0ab1798cde..3b1cfa461c 100644 --- a/bacula/src/win32/compat/compat.h +++ b/bacula/src/win32/compat/compat.h @@ -21,14 +21,17 @@ * Author : Christopher S. Hull * Created On : Fri Jan 30 13:00:51 2004 * Last Modified By: Christopher S. Hull - * Last Modified On: Mon Feb 23 10:39:46 2004 - * Update Count : 202 + * Last Modified On: Tue Feb 24 11:13:32 2004 + * Update Count : 218 * $Id$ */ #ifndef __COMPAT_H_ #define __COMPAT_H_ + +#define __STDC__ 1 + #include #include #include @@ -44,7 +47,6 @@ #include #include #include -//#include #include #include #include @@ -55,8 +57,6 @@ #include #include #include - -#define __STDC__ 1 #include @@ -78,12 +78,17 @@ typedef float float32_t; typedef unsigned short uint16_t; typedef signed short int16_t; typedef long time_t; -typedef long _off_t; +#if __STDC__ +typedef _dev_t dev_t; +typedef __int64 ino_t; +typedef __int64 off_t; /* STDC=1 means we can define this */ +#else +typedef long _off_t; /* must be same as sys/types.h */ +#endif typedef signed char int8_t; typedef int BOOL; #define bool BOOL typedef double float64_t; - typedef UINT32 u_int32_t; typedef unsigned char u_int8_t; typedef unsigned short u_int16_t; @@ -181,6 +186,20 @@ struct stat #define S_ISSOCK(x) 0 #define S_ISLNK(x) 0 + +#if __STDC__ +#define O_RDONLY _O_RDONLY +#define O_WRONLY _O_WRONLY +#define O_RDWR _O_RDWR +#define O_CREAT _O_CREAT +#define O_TRUNC _O_TRUNC + +#define isascii __isascii +#define toascii __toascii +#define iscsymf __iscsymf +#define iscsym __iscsym + +#endif #define SIGUSR2 9999 int umask(int); -- 2.39.5