aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2006-04-12 09:26:10 +0000
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>2006-04-12 09:26:10 +0000
commitb9baa4d9ca4ae4eebe36065f9a82e39d403314cd (patch)
tree49cce390fc41b555abbe654bfdaa6fc1cdb92eff
parentAdded credit and CVE number to security vulnerability fix in 2.0.6. (diff)
downloadopenvpn-b9baa4d9ca4ae4eebe36065f9a82e39d403314cd.tar.xz
svn merge -r 999:1000 $SO/trunk/openvpn .
(Fixed 64-bit counter bug on Windows) git-svn-id: http://svn.openvpn.net/projects/openvpn/branches/BETA21/openvpn@1002 e7ae566f-a301-0410-adde-c780ea21d3b5
-rw-r--r--common.h15
-rw-r--r--syshead.h5
2 files changed, 17 insertions, 3 deletions
diff --git a/common.h b/common.h
index e7320f3..d10758e 100644
--- a/common.h
+++ b/common.h
@@ -26,9 +26,19 @@
#define COMMON_H
/*
- * Statistics counters.
+ * Statistics counters and associated printf formats.
*/
-typedef unsigned long long int counter_type;
+#ifdef USE_64_BIT_COUNTERS
+ typedef unsigned long long int counter_type;
+# ifdef WIN32
+# define counter_format "%I64u"
+# else
+# define counter_format "%llu"
+# endif
+#else
+ typedef unsigned int counter_type;
+# define counter_format "%u"
+#endif
/*
* Time intervals
@@ -43,7 +53,6 @@ typedef int interval_t;
/*
* Printf formats for special types
*/
-#define counter_format "%llu"
#define ptr_format "0x%08lx"
#define time_format "%lu"
#define fragment_header_format "0x%08x"
diff --git a/syshead.h b/syshead.h
index 950af53..f296fe0 100644
--- a/syshead.h
+++ b/syshead.h
@@ -380,6 +380,11 @@ socket_defined (const socket_descriptor_t sd)
}
/*
+ * Should statistics counters be 64 bits?
+ */
+#define USE_64_BIT_COUNTERS
+
+/*
* Do we have point-to-multipoint capability?
*/