summaryrefslogtreecommitdiff
path: root/libs/libmdbx/src/test/chrono.cc
diff options
context:
space:
mode:
authorGeorge Hazan <ghazan@miranda.im>2020-01-07 22:56:32 +0300
committerGeorge Hazan <ghazan@miranda.im>2020-01-07 22:56:39 +0300
commit7524acda0a8778572262429f27b359d7ee91fc90 (patch)
tree6443228a439b83c5bc6d15923a9ccd91fa4718e3 /libs/libmdbx/src/test/chrono.cc
parent62c842df372abe0349f025ac4cbbc8426526ac8b (diff)
libmdbx: update to 0.5.0
Diffstat (limited to 'libs/libmdbx/src/test/chrono.cc')
-rw-r--r--libs/libmdbx/src/test/chrono.cc7
1 files changed, 7 insertions, 0 deletions
diff --git a/libs/libmdbx/src/test/chrono.cc b/libs/libmdbx/src/test/chrono.cc
index 38cb321a81..315d379088 100644
--- a/libs/libmdbx/src/test/chrono.cc
+++ b/libs/libmdbx/src/test/chrono.cc
@@ -16,7 +16,10 @@
namespace chrono {
+#ifndef NSEC_PER_SEC
#define NSEC_PER_SEC 1000000000u
+#endif /* NSEC_PER_SEC */
+
uint32_t ns2fractional(uint32_t ns) {
assert(ns < NSEC_PER_SEC);
/* LY: здесь и далее используется "длинное деление", которое
@@ -30,7 +33,9 @@ uint32_t fractional2ns(uint32_t fractional) {
return (fractional * (uint64_t)NSEC_PER_SEC) >> 32;
}
+#ifndef USEC_PER_SEC
#define USEC_PER_SEC 1000000u
+#endif /* USEC_PER_SEC */
uint32_t us2fractional(uint32_t us) {
assert(us < USEC_PER_SEC);
return ((uint64_t)us << 32) / USEC_PER_SEC;
@@ -40,7 +45,9 @@ uint32_t fractional2us(uint32_t fractional) {
return (fractional * (uint64_t)USEC_PER_SEC) >> 32;
}
+#ifndef MSEC_PER_SEC
#define MSEC_PER_SEC 1000u
+#endif /* MSEC_PER_SEC */
uint32_t ms2fractional(uint32_t ms) {
assert(ms < MSEC_PER_SEC);
return ((uint64_t)ms << 32) / MSEC_PER_SEC;