summaryrefslogtreecommitdiff
path: root/source3/include/includes.h
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2006-01-12 22:17:54 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:06:05 -0500
commit33174847994128387a36a8103f147fe5a96c15fd (patch)
tree72ef01910bac6df965a9e0554c235bab145fa209 /source3/include/includes.h
parent80f2848260d5c9be70f4a037ca3ea5c5b6a76166 (diff)
downloadsamba-33174847994128387a36a8103f147fe5a96c15fd.tar.gz
samba-33174847994128387a36a8103f147fe5a96c15fd.tar.bz2
samba-33174847994128387a36a8103f147fe5a96c15fd.zip
r12877: Stop passing structs around in smb messages, instead
always linearize into little-endian. Should fix all Solaris issues with this, plus provide a cleaner base moving forward for cluster-aware Samba where smbd's can communicate across different compilers/architectures (eventually these message will have to go cross-machine). Jeremy. (This used to be commit d01824b78576a034428e1cef73868d1169057991)
Diffstat (limited to 'source3/include/includes.h')
-rw-r--r--source3/include/includes.h20
1 files changed, 18 insertions, 2 deletions
diff --git a/source3/include/includes.h b/source3/include/includes.h
index 44b5ea1bd7..a9b792d5f6 100644
--- a/source3/include/includes.h
+++ b/source3/include/includes.h
@@ -657,6 +657,20 @@ typedef int socklen_t;
# endif
#endif
+#ifndef LARGE_SMB_DEV_T
+# if (defined(HAVE_EXPLICIT_LARGEFILE_SUPPORT) && defined(HAVE_DEV64_T)) || (defined(SIZEOF_DEV_T) && (SIZEOF_DEV_T == 8))
+# define LARGE_SMB_DEV_T 1
+# endif
+#endif
+
+#ifdef LARGE_SMB_DEV_T
+#define SDEV_T_VAL(p, ofs, v) (SIVAL((p),(ofs),(v)&0xFFFFFFFF), SIVAL((p),(ofs)+4,(v)>>32))
+#define DEV_T_VAL(p, ofs) ((SMB_DEV_T)(((SMB_BIG_UINT)(IVAL((p),(ofs))))| (((SMB_BIG_UINT)(IVAL((p),(ofs)+4))) << 32)))
+#else
+#define SDEV_T_VAL(p, ofs, v) (SIVAL((p),(ofs),v),SIVAL((p),(ofs)+4,0))
+#define DEV_T_VAL(p, ofs) ((SMB_DEV_T)(IVAL((p),(ofs))))
+#endif
+
/*
* Setup the correctly sized inode type.
*/
@@ -676,9 +690,11 @@ typedef int socklen_t;
#endif
#ifdef LARGE_SMB_INO_T
-#define SINO_T(p, ofs, v) (SIVAL(p,ofs,(v)&0xFFFFFFFF), SIVAL(p,(ofs)+4,(v)>>32))
+#define SINO_T_VAL(p, ofs, v) (SIVAL((p),(ofs),(v)&0xFFFFFFFF), SIVAL((p),(ofs)+4,(v)>>32))
+#define INO_T_VAL(p, ofs) ((SMB_INO_T)(((SMB_BIG_UINT)(IVAL(p,ofs)))| (((SMB_BIG_UINT)(IVAL(p,(ofs)+4))) << 32)))
#else
-#define SINO_T(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))
+#define SINO_T_VAL(p, ofs, v) (SIVAL(p,ofs,v),SIVAL(p,(ofs)+4,0))
+#define INO_T_VAL(p, ofs) ((SMB_INO_T)(IVAL((p),(ofs))))
#endif
#ifndef SMB_OFF_T