From 6a499095f681078dfaae26a49efb4f20998800d1 Mon Sep 17 00:00:00 2001 From: gthaker Date: Tue, 11 Feb 2003 15:15:33 +0000 Subject: 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. --- performance-tests/SCTP/SOCK_SEQPACK_clt.cpp | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/performance-tests/SCTP/SOCK_SEQPACK_clt.cpp b/performance-tests/SCTP/SOCK_SEQPACK_clt.cpp index c2f8921a3df..d08bc86c080 100644 --- a/performance-tests/SCTP/SOCK_SEQPACK_clt.cpp +++ b/performance-tests/SCTP/SOCK_SEQPACK_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 +#endif /* WIN32 */ + extern "C" { +#ifndef WIN32 #include +#endif /* WIN32 */ #include }; @@ -251,7 +259,15 @@ HIST runUnmarshalledOctetTest(ACE_CDR::Octet *buf, size_t seqLen, ACE_SOCK_SEQPA 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); -- cgit v1.2.1