]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
svn merge -r 999:1000 $SO/trunk/openvpn .
authorjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Wed, 12 Apr 2006 09:26:10 +0000 (09:26 +0000)
committerjames <james@e7ae566f-a301-0410-adde-c780ea21d3b5>
Wed, 12 Apr 2006 09:26:10 +0000 (09:26 +0000)
(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

common.h
syshead.h

index e7320f32c2866661ad28ac43d393c58d7656c602..d10758e191658c3998958815f56cc7d336ca188d 100644 (file)
--- a/common.h
+++ b/common.h
 #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"
index 950af5331a67063aa0f15073fb8652b75934a8bb..f296fe018dfcee721e3424bdf5940604bd90cd32 100644 (file)
--- a/syshead.h
+++ b/syshead.h
@@ -379,6 +379,11 @@ socket_defined (const socket_descriptor_t sd)
   return sd != SOCKET_UNDEFINED;
 }
 
+/*
+ * Should statistics counters be 64 bits?
+ */
+#define USE_64_BIT_COUNTERS
+
 /*
  * Do we have point-to-multipoint capability?
  */