mirror of
https://github.com/isar/libmdbx.git
synced 2025-01-04 17:44:13 +08:00
mdbx-test: avoid redefine xSEC_PER_SEC.
Change-Id: I67fd2b12d5745f4f14f8da80ee313234a4e35617
This commit is contained in:
parent
7ed1586ea6
commit
13b52b1d51
@ -16,7 +16,10 @@
|
|||||||
|
|
||||||
namespace chrono {
|
namespace chrono {
|
||||||
|
|
||||||
|
#ifndef NSEC_PER_SEC
|
||||||
#define NSEC_PER_SEC 1000000000u
|
#define NSEC_PER_SEC 1000000000u
|
||||||
|
#endif /* NSEC_PER_SEC */
|
||||||
|
|
||||||
uint32_t ns2fractional(uint32_t ns) {
|
uint32_t ns2fractional(uint32_t ns) {
|
||||||
assert(ns < NSEC_PER_SEC);
|
assert(ns < NSEC_PER_SEC);
|
||||||
/* LY: здесь и далее используется "длинное деление", которое
|
/* LY: здесь и далее используется "длинное деление", которое
|
||||||
@ -30,7 +33,9 @@ uint32_t fractional2ns(uint32_t fractional) {
|
|||||||
return (fractional * (uint64_t)NSEC_PER_SEC) >> 32;
|
return (fractional * (uint64_t)NSEC_PER_SEC) >> 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef USEC_PER_SEC
|
||||||
#define USEC_PER_SEC 1000000u
|
#define USEC_PER_SEC 1000000u
|
||||||
|
#endif /* USEC_PER_SEC */
|
||||||
uint32_t us2fractional(uint32_t us) {
|
uint32_t us2fractional(uint32_t us) {
|
||||||
assert(us < USEC_PER_SEC);
|
assert(us < USEC_PER_SEC);
|
||||||
return ((uint64_t)us << 32) / 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;
|
return (fractional * (uint64_t)USEC_PER_SEC) >> 32;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#ifndef MSEC_PER_SEC
|
||||||
#define MSEC_PER_SEC 1000u
|
#define MSEC_PER_SEC 1000u
|
||||||
|
#endif /* MSEC_PER_SEC */
|
||||||
uint32_t ms2fractional(uint32_t ms) {
|
uint32_t ms2fractional(uint32_t ms) {
|
||||||
assert(ms < MSEC_PER_SEC);
|
assert(ms < MSEC_PER_SEC);
|
||||||
return ((uint64_t)ms << 32) / MSEC_PER_SEC;
|
return ((uint64_t)ms << 32) / MSEC_PER_SEC;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user