* lib/stat-time.h: Include stdckdint.h instead of intprops.h.
(stat_time_normalize): Use ckd_add instead of INT_ADD_WRAPV.
* modules/stat-time (Depends-on): Depend on stdckdint, not intprops.
2022-10-10 Paul Eggert <eggert@cs.ucla.edu>
+ stat-time: prefer stdckdint to intprops
+ * lib/stat-time.h: Include stdckdint.h instead of intprops.h.
+ (stat_time_normalize): Use ckd_add instead of INT_ADD_WRAPV.
+ * modules/stat-time (Depends-on): Depend on stdckdint, not intprops.
+
xalloc: remove stray includes + dependencies
These used to be needed, but are not needed now.
* lib/xalloc.h: Do not include stdlib.h.
#ifndef STAT_TIME_H
#define STAT_TIME_H 1
-#include "intprops.h"
-
#include <errno.h>
+#include <stdckdint.h>
#include <stddef.h>
#include <sys/stat.h>
#include <time.h>
/* Overflow is possible, as Solaris 11 stat can yield
tv_sec == TYPE_MINIMUM (time_t) && tv_nsec == -1000000000.
INT_ADD_WRAPV is OK, since time_t is signed on Solaris. */
- if (INT_ADD_WRAPV (q, ts->tv_sec, &ts->tv_sec))
+ if (ckd_add (&ts->tv_sec, q, ts->tv_sec))
{
errno = EOVERFLOW;
return -1;
errno
extensions
extern-inline
-intprops
+stdckdint
configure.ac:
gl_STAT_TIME