summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorgthaker <gthaker@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-02-11 15:15:33 +0000
committergthaker <gthaker@ae88bc3d-4319-0410-8dbf-d08b4c9d3795>2003-02-11 15:15:33 +0000
commit6a499095f681078dfaae26a49efb4f20998800d1 (patch)
treeeb36bc49a41d08cbfe8d5258f1f327026d99e197
parent02ef6441d44f468fa760c35ad12a3cbe2d0c0afb (diff)
downloadATCD-6a499095f681078dfaae26a49efb4f20998800d1.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.
-rw-r--r--performance-tests/SCTP/SOCK_SEQPACK_clt.cpp18
1 files changed, 17 insertions, 1 deletions
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 <math.h>
+#endif /* WIN32 */
+
extern "C" {
+#ifndef WIN32
#include <math.h>
+#endif /* WIN32 */
#include <stdio.h>
};
@@ -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);