Provide alternate F_LENGTH() define for systems with no 64-bit type.
authorWayne Davison <wayned@samba.org>
Tue, 12 Dec 2006 14:55:21 +0000 (14:55 +0000)
committerWayne Davison <wayned@samba.org>
Tue, 12 Dec 2006 14:55:21 +0000 (14:55 +0000)
rsync.h

diff --git a/rsync.h b/rsync.h
index e07ac9f..75745f5 100644 (file)
--- a/rsync.h
+++ b/rsync.h
@@ -539,8 +539,12 @@ extern int preserve_gid;
 
 /* Basename (AKA filename) and length applies to all items */
 #define F_BASENAME(f) ((const char*)(f) + FILE_STRUCT_LEN)
 
 /* Basename (AKA filename) and length applies to all items */
 #define F_BASENAME(f) ((const char*)(f) + FILE_STRUCT_LEN)
-#define F_LENGTH(f) ((OFF_T)(f)->len32 + ((f)->flags & FLAG_LENGTH64 \
-                  ? (OFF_T)OPT_EXTRA(f, 0)->unum << 32 : 0u))
+#if SIZEOF_INT64 < 8
+#define F_LENGTH(f) ((int64)(f)->len32)
+#else
+#define F_LENGTH(f) ((int64)(f)->len32 + ((f)->flags & FLAG_LENGTH64 \
+                  ? (int64)OPT_EXTRA(f, 0)->unum << 32 : 0))
+#endif
 
 /* If there is a symlink string, it is always right after the basename */
 #define F_SYMLINK(f) (F_BASENAME(f) + strlen(F_BASENAME(f)) + 1)
 
 /* If there is a symlink string, it is always right after the basename */
 #define F_SYMLINK(f) (F_BASENAME(f) + strlen(F_BASENAME(f)) + 1)