1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-18 10:35:55 +00:00

Improve r264388 removing namespace pollution previously introduced in

<sys/time.h>. INT64_MAX actually requires __INT64_C() hack to get the
type right on exotic architectures (e.g. on ones with 63-bit ints or long
0x7fffffffffffffff is unsigned int or long). The hardcoded LL suffix is
good enough to avoid these problems for SBT_MAX (it makes the type always
signed long long, without overflow since long long has at least 64 bits).
Many thanks to Bruce Evans for the time spent me to explain this.

Reported by:	bde
Reviewed by:	bde
This commit is contained in:
Davide Italiano 2014-06-26 05:23:48 +00:00
parent 7847796a93
commit 3a8106f528
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=267896

View File

@ -129,7 +129,7 @@ bintime_shift(struct bintime *_bt, int _exp)
#define SBT_1MS (SBT_1S / 1000)
#define SBT_1US (SBT_1S / 1000000)
#define SBT_1NS (SBT_1S / 1000000000)
#define SBT_MAX INT64_MAX
#define SBT_MAX 0x7fffffffffffffffLL
static __inline int
sbintime_getsec(sbintime_t _sbt)