From 7c2399115153609edc87a4c487d18e7f8b41dcba Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Mon, 2 Jul 2012 01:42:35 -0400 Subject: [PATCH] Add HAVE_INT64TOINT32 test in stds.h Windows SDK v6.0 and above include a platform specific definition of Int64ToInt32. Use the platform definition when available. Change-Id: I8081ed1c33d2ac11287ebaa1eaef1f77682575cf Reviewed-on: http://gerrit.openafs.org/7622 Tested-by: BuildBot Reviewed-by: Jeffrey Altman --- src/config/param.amd64_w2k.h | 1 + src/config/param.i386_w2k.h | 1 + src/config/param.i64_w2k.h | 2 +- src/config/stds.h | 2 ++ 4 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/config/param.amd64_w2k.h b/src/config/param.amd64_w2k.h index c7427addc2..ed95b20f9b 100644 --- a/src/config/param.amd64_w2k.h +++ b/src/config/param.amd64_w2k.h @@ -21,6 +21,7 @@ #define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */ #define AFS_KRB5_ERROR_ENV 1 /* fetch_krb5_error_message() available in afsutil.lib */ #define HAVE_SSIZE_T 1 +#define HAVE_INT64TOINT32 1 #include #define SYS_NAME_ID SYS_NAME_ID_amd64_w2k diff --git a/src/config/param.i386_w2k.h b/src/config/param.i386_w2k.h index b98c22a148..cc00cdd964 100644 --- a/src/config/param.i386_w2k.h +++ b/src/config/param.i386_w2k.h @@ -21,6 +21,7 @@ #define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */ #define AFS_KRB5_ERROR_ENV 1 /* fetch_krb5_error_message() available in afsutil.lib */ #define HAVE_SSIZE_T 1 +#define HAVE_INT64TOINT32 1 #include #define SYS_NAME_ID SYS_NAME_ID_i386_w2k diff --git a/src/config/param.i64_w2k.h b/src/config/param.i64_w2k.h index f6dc1c9224..703ab0a790 100644 --- a/src/config/param.i64_w2k.h +++ b/src/config/param.i64_w2k.h @@ -19,7 +19,7 @@ #define AFS_64BIT_IOPS_ENV 1 #define AFS_NAMEI_ENV 1 /* User space interface to file system */ #define AFS_HAVE_STATVFS 0 /* System doesn't support statvfs */ -#define HAVE_SSIZE_T 1 +#define HAVE_INT64TOINT32 1 #include #define SYS_NAME_ID SYS_NAME_ID_i64_w2k diff --git a/src/config/stds.h b/src/config/stds.h index cf023d2b83..8aa2eff439 100644 --- a/src/config/stds.h +++ b/src/config/stds.h @@ -85,7 +85,9 @@ typedef unsigned long long afs_uint64; #define CompareInt64(a,b) (afs_int64)(a) - (afs_int64)(b) #define CompareUInt64(a,b) (afs_uint64)(a) - (afs_uint64)(b) #define NonZeroInt64(a) (a) +#ifndef HAVE_INT64TOINT32 #define Int64ToInt32(a) (a) & MAX_AFS_UINT32 +#endif #define FillInt64(t,h,l) (t) = ((afs_int64)(h) << 32) | (l); #define SplitInt64(t,h,l) (h) = ((afs_int64)t) >> 32; (l) = (t) & MAX_AFS_UINT32; #define RoundInt64ToInt32(a) (a > MAX_AFS_UINT32) ? MAX_AFS_UINT32 : a;