@@ -67,7 +67,7 @@ typedef struct mcd_duration {
67
67
* monotonically increasing time, and does not necessarily correlate with
68
68
* any real-world clock.
69
69
*/
70
- static inline mcd_time_point
70
+ static BSON_INLINE mcd_time_point
71
71
mcd_now (void )
72
72
{
73
73
// Create a time point representing the current time.
@@ -83,7 +83,7 @@ mcd_now (void)
83
83
* @note Saturates to the min/max duration if the duration is too great in
84
84
* magnitude.
85
85
*/
86
- static inline mcd_duration
86
+ static BSON_INLINE mcd_duration
87
87
mcd_microseconds (int64_t s )
88
88
{
89
89
// 'mcd_duration' is encoded in a number of microseconds, so we don't need to
@@ -100,7 +100,7 @@ mcd_microseconds (int64_t s)
100
100
* @note Saturates to the min/max duration if the duration is too great in
101
101
* magnitude.
102
102
*/
103
- static inline mcd_duration
103
+ static BSON_INLINE mcd_duration
104
104
mcd_milliseconds (int64_t s )
105
105
{
106
106
// 1'000 microseconds per millisecond:
@@ -119,7 +119,7 @@ mcd_milliseconds (int64_t s)
119
119
* @note Saturates to the min/max duration if the duration is too great in
120
120
* magnitude.
121
121
*/
122
- static inline mcd_duration
122
+ static BSON_INLINE mcd_duration
123
123
mcd_seconds (int64_t s )
124
124
{
125
125
// 1'000 milliseconds per second:
@@ -138,7 +138,7 @@ mcd_seconds (int64_t s)
138
138
* @note Saturates to the min/max duration if the duration is too great in
139
139
* magnitude.
140
140
*/
141
- static inline mcd_duration
141
+ static BSON_INLINE mcd_duration
142
142
mcd_minutes (int64_t m )
143
143
{
144
144
// Sixty seconds per minute:
@@ -157,7 +157,7 @@ mcd_minutes (int64_t m)
157
157
* @note Does not round-trip with `mcd_milliseconds(N)` if N-milliseconds is
158
158
* unrepresentable in the duration type. This only occurs in extreme durations
159
159
*/
160
- static inline int64_t
160
+ static BSON_INLINE int64_t
161
161
mcd_get_milliseconds (mcd_duration d )
162
162
{
163
163
return d ._rep / 1000 ;
@@ -176,7 +176,7 @@ mcd_get_milliseconds (mcd_duration d)
176
176
* @note If the resulting point-in-time is unrepresentable, the return value
177
177
* will be clamped to MCD_TIME_POINT_MIN or MCD_TIME_POINT_MAX.
178
178
*/
179
- static inline mcd_time_point
179
+ static BSON_INLINE mcd_time_point
180
180
mcd_later (mcd_time_point from , mcd_duration delta )
181
181
{
182
182
if (_mcd_i64_add_would_overflow (from ._rep , delta ._rep )) {
@@ -202,7 +202,7 @@ mcd_later (mcd_time_point from, mcd_duration delta)
202
202
* "from", you will receive a paradoxical *negative* duration, indicating
203
203
* the amount of time needed to time-travel backwards to reach "then."
204
204
*/
205
- static inline mcd_duration
205
+ static BSON_INLINE mcd_duration
206
206
mcd_time_difference (mcd_time_point then , mcd_time_point from )
207
207
{
208
208
if (_mcd_i64_sub_would_overflow (then ._rep , from ._rep )) {
@@ -229,7 +229,7 @@ mcd_time_difference (mcd_time_point then, mcd_time_point from)
229
229
* @retval >0 If 'right' is before 'left'
230
230
* @retval 0 If 'left' and 'right' are equivalent
231
231
*/
232
- static inline int
232
+ static BSON_INLINE int
233
233
mcd_time_compare (mcd_time_point left , mcd_time_point right )
234
234
{
235
235
// Obtain the amount of time needed to wait from 'right' to reach
@@ -257,7 +257,7 @@ mcd_time_compare (mcd_time_point left, mcd_time_point right)
257
257
* @retval >0 If left is "greater than" right
258
258
* @retval 0 If left and right are equivalent
259
259
*/
260
- static inline int
260
+ static BSON_INLINE int
261
261
mcd_duration_compare (mcd_duration left , mcd_duration right )
262
262
{
263
263
if (left ._rep < right ._rep ) {
@@ -279,7 +279,7 @@ mcd_duration_compare (mcd_duration left, mcd_duration right)
279
279
* @retval max If `dur` > `max`
280
280
* @retval dur Otherwise
281
281
*/
282
- static inline mcd_duration
282
+ static BSON_INLINE mcd_duration
283
283
mcd_duration_clamp (mcd_duration dur , mcd_duration min , mcd_duration max )
284
284
{
285
285
BSON_ASSERT (mcd_duration_compare (min , max ) <= 0 &&
@@ -303,7 +303,7 @@ typedef struct mcd_timer {
303
303
} mcd_timer ;
304
304
305
305
/// Create a time that will expire at the given time
306
- static inline mcd_timer
306
+ static BSON_INLINE mcd_timer
307
307
mcd_timer_expire_at (mcd_time_point time )
308
308
{
309
309
return (mcd_timer ){time };
@@ -316,7 +316,7 @@ mcd_timer_expire_at (mcd_time_point time)
316
316
* @note If the duration is less-than or equal-to zero, the timer will already
317
317
* have expired
318
318
*/
319
- static inline mcd_timer
319
+ static BSON_INLINE mcd_timer
320
320
mcd_timer_expire_after (mcd_duration after )
321
321
{
322
322
return mcd_timer_expire_at (mcd_later (mcd_now (), after ));
@@ -331,7 +331,7 @@ mcd_timer_expire_after (mcd_duration after)
331
331
* @note If the timer is already expired, returns a zero duration. Will never
332
332
* return a negative duration.
333
333
*/
334
- static inline mcd_duration
334
+ static BSON_INLINE mcd_duration
335
335
mcd_timer_remaining (mcd_timer timer )
336
336
{
337
337
// Compute the distance until the expiry time relative to now
0 commit comments