Windows: fix definition of lstat() macro
authorJeffrey Altman <jaltman@your-file-system.com>
Mon, 14 Jun 2010 17:36:32 +0000 (13:36 -0400)
committerJeffrey Altman <jaltman@openafs.org>
Mon, 14 Jun 2010 18:54:23 +0000 (11:54 -0700)
The lstat() macro definition has to take into account
the version of the compiler and the size of time_t.

Change-Id: Id7ad8c3956bba9832cc028db628cfabe58a1d8d9
Reviewed-on: http://gerrit.openafs.org/2158
Reviewed-by: Jeffrey Altman <jaltman@openafs.org>
Tested-by: Jeffrey Altman <jaltman@openafs.org>

src/config/param.amd64_w2k.h
src/config/param.i386_nt40.h
src/config/param.i386_w2k.h
src/config/param.i64_w2k.h

index e0aa08b..55225b9 100644 (file)
@@ -41,7 +41,16 @@ typedef __int64 ssize_t;
 
 /* map lstat calls to _stat, until an AFS-aware lstat wrapper
  * can be written */
-#define lstat(a, b)       _stat((a), (b))
+
+#if (_MSC_VER < 1400)
+#define lstat(a, b)       _stat((a), (struct _stat *)(b))
+#else
+#ifdef _USE_32BIT_TIME_T
+#define lstat(a, b)       _stat((a), (struct _stat32 *)(b))
+#else
+#define lstat(a, b)       _stat((a), (struct _stat64i32 *)(b))
+#endif 
+#endif
 
 #if 0
 #define memset(A, 0, S) memset((void*)(A), 0, (size_t)(S))
index dde4750..418c5c7 100644 (file)
@@ -39,6 +39,10 @@ typedef int ssize_t;
 /* these macros define Unix-style functions missing in  VC++5.0/NT4.0 */
 #define MAXPATHLEN _MAX_PATH
 
+/* map lstat calls to _stat, until an AFS-aware lstat wrapper
+ * can be written */
+#define lstat(a, b)       _stat((a), (struct _stat *)(b))
+
 #if 0
 #define memset(A, 0, S) memset((void*)(A), 0, (size_t)(S))
 #define memcpy(B, A, S) memcpy((void*)(B), (void*)(A), (size_t)(S))
index 151e2e6..7b200e0 100644 (file)
@@ -41,7 +41,15 @@ typedef int ssize_t;
 
 /* map lstat calls to _stat, until an AFS-aware lstat wrapper
  * can be written */
-#define lstat(a, b)       _stat((a), (b))
+#if (_MSC_VER < 1400)
+#define lstat(a, b)       _stat((a), (struct _stat *)(b))
+#else
+#ifdef _USE_32BIT_TIME_T
+#define lstat(a, b)       _stat((a), (struct _stat32 *)(b))
+#else
+#define lstat(a, b)       _stat((a), (struct _stat64i32 *)(b))
+#endif 
+#endif
 
 #if 0
 #define memset(A, 0, S) memset((void*)(A), 0, (size_t)(S))
index 3bfe971..a96d7a7 100644 (file)
@@ -40,7 +40,15 @@ typedef __int64 ssize_t;
 
 /* map lstat calls to _stat, until an AFS-aware lstat wrapper
  * can be written */
-#define lstat(a, b)       _stat((a), (b))
+#if (_MSC_VER < 1400)
+#define lstat(a, b)       _stat((a), (struct _stat *)(b))
+#else
+#ifdef _USE_32BIT_TIME_T
+#define lstat(a, b)       _stat((a), (struct _stat32 *)(b))
+#else
+#define lstat(a, b)       _stat((a), (struct _stat64i32 *)(b))
+#endif 
+#endif
 
 #if 0
 #define memset(A, 0, S) memset((void*)(A), 0, (size_t)(S))