]> git.ipfire.org Git - thirdparty/openvpn.git/commitdiff
Revert "Remove always enabled USE_64_BIT_COUNTERS define"
authorGert Doering <gert@greenie.muc.de>
Thu, 22 Apr 2021 08:26:12 +0000 (10:26 +0200)
committerGert Doering <gert@greenie.muc.de>
Thu, 22 Apr 2021 08:26:12 +0000 (10:26 +0200)
This reverts commit 1bdd09e7e019ac6d8fdc1b009bdec818b9183e76 - it was
not indended to be ever merged to release/2.4, but only as a refactoring
commit intended to go to master.

The master commit is 3a16a8678ded8df8e.

src/openvpn/common.h
src/openvpn/syshead.h

index 22722571c056ce81c7ee34ca4a675e5162ae4bc3..0f732008aa52abb08e348fb8864a2293e879bde5 100644 (file)
 #define COMMON_H
 
 /*
- * Statistics counters and associated printf format.
+ * Statistics counters and associated printf formats.
  */
-typedef uint64_t counter_type;
-#define counter_format  "%" PRIu64
+#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  /* ifdef USE_64_BIT_COUNTERS */
+typedef unsigned int counter_type;
+#define counter_format   "%u"
+#endif
 
 /*
  * Time intervals
index 05d790ad927358a4c4826f08f48880c99e164b1e..3ac9d70c370bdf3462081053e9896211abbe2346 100644 (file)
@@ -496,6 +496,11 @@ socket_defined(const socket_descriptor_t sd)
     return sd != SOCKET_UNDEFINED;
 }
 
+/*
+ * Should statistics counters be 64 bits?
+ */
+#define USE_64_BIT_COUNTERS
+
 /*
  * Should we enable the use of execve() for calling subprocesses,
  * instead of system()?