mirror of
https://gitlab.com/sortix/sortix.git
synced 2023-02-13 20:55:38 -05:00
Fix usage of inline keyword in <timespec.h>.
This commit is contained in:
parent
f2857047b0
commit
bcbc974a05
1 changed files with 9 additions and 9 deletions
|
@ -44,41 +44,41 @@ __END_DECLS
|
|||
|
||||
__BEGIN_DECLS
|
||||
|
||||
static inline bool timespec_eq(struct timespec a, struct timespec b)
|
||||
static __inline bool timespec_eq(struct timespec a, struct timespec b)
|
||||
{
|
||||
return a.tv_sec == b.tv_sec && a.tv_nsec == b.tv_nsec;
|
||||
}
|
||||
|
||||
static inline bool timespec_neq(struct timespec a, struct timespec b)
|
||||
static __inline bool timespec_neq(struct timespec a, struct timespec b)
|
||||
{
|
||||
return a.tv_sec != b.tv_sec || a.tv_nsec != b.tv_nsec;
|
||||
}
|
||||
|
||||
static inline bool timespec_lt(struct timespec a, struct timespec b)
|
||||
static __inline bool timespec_lt(struct timespec a, struct timespec b)
|
||||
{
|
||||
return a.tv_sec < b.tv_sec ||
|
||||
(a.tv_sec == b.tv_sec && a.tv_nsec < b.tv_nsec);
|
||||
}
|
||||
|
||||
static inline bool timespec_le(struct timespec a, struct timespec b)
|
||||
static __inline bool timespec_le(struct timespec a, struct timespec b)
|
||||
{
|
||||
return a.tv_sec < b.tv_sec ||
|
||||
(a.tv_sec == b.tv_sec && a.tv_nsec <= b.tv_nsec);
|
||||
}
|
||||
|
||||
static inline bool timespec_gt(struct timespec a, struct timespec b)
|
||||
static __inline bool timespec_gt(struct timespec a, struct timespec b)
|
||||
{
|
||||
return a.tv_sec > b.tv_sec ||
|
||||
(a.tv_sec == b.tv_sec && a.tv_nsec > b.tv_nsec);
|
||||
}
|
||||
|
||||
static inline bool timespec_ge(struct timespec a, struct timespec b)
|
||||
static __inline bool timespec_ge(struct timespec a, struct timespec b)
|
||||
{
|
||||
return a.tv_sec > b.tv_sec ||
|
||||
(a.tv_sec == b.tv_sec && a.tv_nsec >= b.tv_nsec);
|
||||
}
|
||||
|
||||
static inline struct timespec timespec_make(time_t sec, long nsec)
|
||||
static __inline struct timespec timespec_make(time_t sec, long nsec)
|
||||
{
|
||||
struct timespec ret;
|
||||
ret.tv_sec = sec;
|
||||
|
@ -86,14 +86,14 @@ static inline struct timespec timespec_make(time_t sec, long nsec)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static inline struct timespec timespec_neg(struct timespec t)
|
||||
static __inline struct timespec timespec_neg(struct timespec t)
|
||||
{
|
||||
if ( t.tv_nsec )
|
||||
return timespec_make(-t.tv_sec - 1, 1000000000 - t.tv_nsec);
|
||||
return timespec_make(-t.tv_sec, 0);
|
||||
}
|
||||
|
||||
static inline struct timespec timespec_nul()
|
||||
static __inline struct timespec timespec_nul()
|
||||
{
|
||||
return timespec_make(0, 0);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue