From 13b52b1d51d9e77f7a719d17d9fe93604e60db80 Mon Sep 17 00:00:00 2001 From: Leonid Yuriev Date: Thu, 10 Oct 2019 22:46:43 +0300 Subject: [PATCH] mdbx-test: avoid redefine xSEC_PER_SEC. Change-Id: I67fd2b12d5745f4f14f8da80ee313234a4e35617 --- test/chrono.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/test/chrono.cc b/test/chrono.cc index 38cb321a..315d3790 100644 --- a/test/chrono.cc +++ b/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;