bool in_utc_timezone(void);
static inline usec_t usec_add(usec_t a, usec_t b) {
-
- /* Adds two time values, and makes sure USEC_INFINITY as input results as USEC_INFINITY in output, and doesn't
- * overflow. */
+ /* Adds two time values, and makes sure USEC_INFINITY as input results as USEC_INFINITY in output,
+ * and doesn't overflow. */
if (a > USEC_INFINITY - b) /* overflow check */
return USEC_INFINITY;
}
static inline usec_t usec_sub_unsigned(usec_t timestamp, usec_t delta) {
-
if (timestamp == USEC_INFINITY) /* Make sure infinity doesn't degrade */
return USEC_INFINITY;
if (timestamp < delta)
}
#if SIZEOF_TIME_T == 8
-/* The last second we can format is 31. Dec 9999, 1s before midnight, because otherwise we'd enter 5 digit year
- * territory. However, since we want to stay away from this in all timezones we take one day off. */
-#define USEC_TIMESTAMP_FORMATTABLE_MAX ((usec_t) 253402214399000000)
+ /* The last second we can format is 31. Dec 9999, 1s before midnight, because otherwise we'd enter 5 digit
+ * year territory. However, since we want to stay away from this in all timezones we take one day off. */
+# define USEC_TIMESTAMP_FORMATTABLE_MAX ((usec_t) 253402214399000000)
#elif SIZEOF_TIME_T == 4
/* With a 32bit time_t we can't go beyond 2038... */
-#define USEC_TIMESTAMP_FORMATTABLE_MAX ((usec_t) 2147483647000000)
+# define USEC_TIMESTAMP_FORMATTABLE_MAX ((usec_t) 2147483647000000)
#else
-#error "Yuck, time_t is neither 4 nor 8 bytes wide?"
+# error "Yuck, time_t is neither 4 nor 8 bytes wide?"
#endif
int time_change_fd(void);