diff options
author | gthaker <gthaker@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-02-06 21:42:03 +0000 |
---|---|---|
committer | gthaker <gthaker@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 2003-02-06 21:42:03 +0000 |
commit | c416df1fb020876bf862c9acc2ecb1cfaad87bf5 (patch) | |
tree | 6d0db339f0e28ec652f8bbffbc8d4bbc0b15d48e /performance-tests | |
parent | 89e79e3d20baf14bbe434ae88ec388c78f81f1eb (diff) | |
download | ATCD-c416df1fb020876bf862c9acc2ecb1cfaad87bf5.tar.gz |
If we are compiling on WIN32, then '#include "math.h"' is not wrapped
by 'extern "C"'. This is because WIN32 math.h may contain template
code.
The expression to compute message latency (variable
messageLatency_usec) now involves the ACE_UINT64_DBLCAST_ADAPTER
macro, which is needed by WIN32.
Diffstat (limited to 'performance-tests')
-rw-r--r-- | performance-tests/SCTP/SOCK_STREAM_clt.cpp | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/performance-tests/SCTP/SOCK_STREAM_clt.cpp b/performance-tests/SCTP/SOCK_STREAM_clt.cpp index 7deb3397a16..3f2f836dd55 100644 --- a/performance-tests/SCTP/SOCK_STREAM_clt.cpp +++ b/performance-tests/SCTP/SOCK_STREAM_clt.cpp @@ -1,7 +1,15 @@ // $Id$ +// On WIN32, math.h may contain template code, +// which cannot be wrapped by 'extern "C"' +#ifdef WIN32 +#include <math.h> +#endif /* WIN32 */ + extern "C" { +#ifndef WIN32 #include <math.h> +#endif /* WIN32 */ #include <stdio.h> }; @@ -260,7 +268,14 @@ HIST runUnmarshalledOctetTest(ACE_CDR::Octet *buf, size_t seqLen, ACE_SOCK_Strea 0); // compute the message latency in micro-seconds - messageLatency_usec = (endTime-startTime)/microsec_clock_scale_factor; + messageLatency_usec = + + (ACE_static_cast(double, + ACE_UINT64_DBLCAST_ADAPTER(endTime)) - + ACE_static_cast(double, + ACE_UINT64_DBLCAST_ADAPTER(startTime))) + + / microsec_clock_scale_factor; // record the message latency in the histogram record(messageLatency_usec, aceStream_hist); |