diff options
author | Ossama Othman <ossama-othman@users.noreply.github.com> | 2006-10-26 23:07:24 +0000 |
---|---|---|
committer | Ossama Othman <ossama-othman@users.noreply.github.com> | 2006-10-26 23:07:24 +0000 |
commit | ec9496bea543bd5ebb9214880c056b95446b6b13 (patch) | |
tree | f13a58e9814886bf7627a4f566caa7425bd61a25 /ACE/ace/OS_NS_macros.h | |
parent | d4ce64ef75457044ad7a9334f787d24fbb4c0a23 (diff) | |
download | ATCD-ec9496bea543bd5ebb9214880c056b95446b6b13.tar.gz |
ChangeLogTag:Thu Oct 27 01:59:19 UTC 2006 Ossama Othman <ossama_othman at symantec dot com>
Diffstat (limited to 'ACE/ace/OS_NS_macros.h')
-rw-r--r-- | ACE/ace/OS_NS_macros.h | 40 |
1 files changed, 40 insertions, 0 deletions
diff --git a/ACE/ace/OS_NS_macros.h b/ACE/ace/OS_NS_macros.h index 02a4aa334bd..8f47d150679 100644 --- a/ACE/ace/OS_NS_macros.h +++ b/ACE/ace/OS_NS_macros.h @@ -69,6 +69,46 @@ #endif /* !ACE_WIN32 */ +// Helper functions to split large intergers into smaller high-order +// and low-order parts, and reconstitute them again. These are +// required primarily for supporting _FILE_OFFSET_BITS==64 on windows. + +#if defined(ACE_WIN32) +# if defined(_FILE_OFFSET_BITS) && (_FILE_OFFSET_BITS==64) +# include "ace/Basic_Types.h" + +# define ACE_LOW_PART(X) static_cast<DWORD>(X) + +ACE_BEGIN_VERSIONED_NAMESPACE_DECL +LONG +inline ACE_High_Part (ACE_OFF_T value) +{ + LARGE_INTEGER new_value; + new_value.QuadPart = value; + return new_value.HighPart; +} +# define ACE_HIGH_PART(X) ACE_High_Part(X) + +LONGLONG +inline ACE_Combine_Parts (LONG high, DWORD low) +{ + LARGE_INTEGER value; + value.LowPart = low; // DWORD + value.HighPart = high; // LONG + return value.QuadPart; +} +ACE_END_VERSIONED_NAMESPACE_DECL + +# define ACE_COMBINE_PARTS(X,Y) ACE_Combine_Parts(X,Y) +# else /* _FILE_OFFSET_BITS==64 */ +# define ACE_LOW_PART(X) X +# define ACE_HIGH_PART(X) 0 +# define ACE_COMBINE_PARTS(X,Y) X +# endif /* _FILE_OFFSET_BITS==64 */ +#endif /* ACE_WIN32 */ + + + # include /**/ "ace/post.h" #endif /* ACE_OS_NS_MACROS_H */ |