diff options
author | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-06-20 22:36:53 +0000 |
---|---|---|
committer | parsons <parsons@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2001-06-20 22:36:53 +0000 |
commit | d2efc45d99344abd05c26e40a3e4fc873625cbe8 (patch) | |
tree | c9bb25bf1a543026b90f6d14cf975de0dd06c004 | |
parent | 070add4057c29e80455213ba7b6485d2ba3cca48 (diff) | |
download | ATCD-d2efc45d99344abd05c26e40a3e4fc873625cbe8.tar.gz |
ChangeLogTag: Wed Jun 20 17:31:32 2001 Jeff Parsons <parsons@cs.wustl.edu>
-rw-r--r-- | ace/CDR_Base.cpp | 14 | ||||
-rw-r--r-- | ace/CDR_Base.h | 60 |
2 files changed, 51 insertions, 23 deletions
diff --git a/ace/CDR_Base.cpp b/ace/CDR_Base.cpp index 62ef8c6e34c..f5e76b0dd5f 100644 --- a/ace/CDR_Base.cpp +++ b/ace/CDR_Base.cpp @@ -531,6 +531,20 @@ ACE_CDR::consolidate (ACE_Message_Block *dst, } } +#if defined (NONNATIVE_LONGLONG) +int +ACE_CDR::LongLong::operator== (const ACE_CDR::LongLong &rhs) const +{ + return this->h == rhs.h && this->l == rhs.l; +} + +int +ACE_CDR::LongLong::operator!= (const ACE_CDR::LongLong &rhs) const +{ + return this->l != rhs.l || this->h != rhs.h; +} +#endif /* NONNATIVE_LONGLONG */ + #if defined (NONNATIVE_LONGDOUBLE) int ACE_CDR::LongDouble::operator== (const ACE_CDR::LongDouble &rhs) const diff --git a/ace/CDR_Base.h b/ace/CDR_Base.h index ae6681a1274..884fd196e25 100644 --- a/ace/CDR_Base.h +++ b/ace/CDR_Base.h @@ -181,27 +181,41 @@ public: typedef long LongLong; # elif ACE_SIZEOF_LONG_LONG == 8 && !defined (ACE_LACKS_LONGLONG_T) # if defined (sun) && !defined (ACE_LACKS_U_LONGLONG_T) && !defined (__KCC) - // sun #defines u_longlong_t, maybe other platforms do also. - // Use it, at least with g++, so that its -pedantic doesn't - // complain about no ANSI C++ long long. - typedef longlong_t LongLong; + // sun #defines u_longlong_t, maybe other platforms do also. + // Use it, at least with g++, so that its -pedantic doesn't + // complain about no ANSI C++ long long. + typedef longlong_t LongLong; # else - // LynxOS 2.5.0 and Linux don't have u_longlong_t. - typedef long long LongLong; + // LynxOS 2.5.0 and Linux don't have u_longlong_t. + typedef long long LongLong; # endif /* sun */ # else /* no native 64 bit integer type */ - - // If "long long" isn't native, programs can't use these data - // types in normal arithmetic expressions. If any particular - // application can cope with the loss of range, it can define - // conversion operators itself. + # define NONNATIVE_LONGLONG # if defined (ACE_BIG_ENDIAN) - struct LongLong { ACE_CDR::Long h, l; }; + struct ACE_Export LongLong + { + ACE_CDR::Long h; + ACE_CDR::Long l; + int operator== (const LongLong &rhs) const; + int operator!= (const LongLong &rhs) const; + }; # else - struct LongLong { ACE_CDR::Long l, h; }; + struct ACE_Export LongLong + { + ACE_CDR::Long l; + ACE_CDR::Long h; + int operator== (const LongLong &rhs) const; + int operator!= (const LongLong &rhs) const; + }; # endif /* ! ACE_BIG_ENDIAN */ # endif /* no native 64 bit integer type */ + # if defined (NONNATIVE_LONGLONG) + # define ACE_CDR_LONGLONG_INITIALIZER {0,0} + # else + # define ACE_CDR_LONGLONG_INITIALIZER 0 + # endif /* NONNATIVE_LONGLONG */ + # if ACE_SIZEOF_FLOAT == 4 typedef float Float; # else /* ACE_SIZEOF_FLOAT != 4 */ @@ -244,18 +258,18 @@ public: // extension, not yet standard. # if ACE_SIZEOF_LONG_DOUBLE == 16 - typedef long double LongDouble; -#define ACE_CDR_LONG_DOUBLE_INITIALIZER 0 + typedef long double LongDouble; + #define ACE_CDR_LONG_DOUBLE_INITIALIZER 0 # else # define NONNATIVE_LONGDOUBLE -#define ACE_CDR_LONG_DOUBLE_INITIALIZER {{0}} - struct ACE_Export LongDouble - { - char ld[16]; - int operator== (const LongDouble &rhs) const; - int operator!= (const LongDouble &rhs) const; - // @@ also need other comparison operators. - }; + # define ACE_CDR_LONG_DOUBLE_INITIALIZER {{0}} + struct ACE_Export LongDouble + { + char ld[16]; + int operator== (const LongDouble &rhs) const; + int operator!= (const LongDouble &rhs) const; + // @@ also need other comparison operators. + }; # endif /* ACE_SIZEOF_LONG_DOUBLE != 16 */ #if !defined (ACE_CDR_GIOP_MAJOR_VERSION) |