code using `volatile' can become incorrect without. Disable with care. */
#undef volatile
-/*
- * Macros to convert ctime and mtime into timevals.
- */
-#define timespec2timeval(_ts, _tv) do { \
- (_tv)->tv_sec = (_ts)->tv_sec; \
- (_tv)->tv_usec = (_ts)->tv_nsec / 1000; \
-} while (0)
-
-#ifdef HAVE_ST_MTIM
-# ifdef HAVE_ST__TIM
-# define ctim_get(_x, _y) timespec2timeval(&(_x)->st_ctim.st__tim, (_y))
-# define mtim_get(_x, _y) timespec2timeval(&(_x)->st_mtim.st__tim, (_y))
-# else
-# define ctim_get(_x, _y) timespec2timeval(&(_x)->st_ctim, (_y))
-# define mtim_get(_x, _y) timespec2timeval(&(_x)->st_mtim, (_y))
-# endif
-#else
-# ifdef HAVE_ST_MTIMESPEC
-# define ctim_get(_x, _y) timespec2timeval(&(_x)->st_ctimespec, (_y))
-# define mtim_get(_x, _y) timespec2timeval(&(_x)->st_mtimespec, (_y))
-# else
-# define ctim_get(_x, _y) do { (_y)->tv_sec = (_x)->st_ctime; (_y)->tv_usec = 0; } while (0)
-# define mtim_get(_x, _y) do { (_y)->tv_sec = (_x)->st_mtime; (_y)->tv_usec = 0; } while (0)
-# endif /* HAVE_ST_MTIMESPEC */
-#endif /* HAVE_ST_MTIM */
-
-#ifdef __GNUC__
-# define ignore_result(x) do { \
- __typeof__(x) y = (x); \
- (void)y; \
-} while(0)
-#else
-# define ignore_result(x) (void)(x)
-#endif
-
/* BSD compatibility on some SVR4 systems. */
#ifdef __svr4__
# define BSD_COMP
} while (0)
#endif
+/*
+ * Macros to extract ctime and mtime as timevals.
+ */
+#ifdef HAVE_ST_MTIM
+# ifdef HAVE_ST__TIM
+# define ctim_get(_x, _y) TIMESPEC_TO_TIMEVAL((_y), &(_x)->st_ctim.st__tim)
+# define mtim_get(_x, _y) TIMESPEC_TO_TIMEVAL((_y), &(_x)->st_mtim.st__tim)
+# else
+# define ctim_get(_x, _y) TIMESPEC_TO_TIMEVAL((_y), &(_x)->st_ctim)
+# define mtim_get(_x, _y) TIMESPEC_TO_TIMEVAL((_y), &(_x)->st_mtim)
+# endif
+#else
+# ifdef HAVE_ST_MTIMESPEC
+# define ctim_get(_x, _y) TIMESPEC_TO_TIMEVAL((_y), &(_x)->st_ctimespec)
+# define mtim_get(_x, _y) TIMESPEC_TO_TIMEVAL((_y), &(_x)->st_mtimespec)
+# else
+# define ctim_get(_x, _y) do { (_y)->tv_sec = (_x)->st_ctime; (_y)->tv_usec = 0; } while (0)
+# define mtim_get(_x, _y) do { (_y)->tv_sec = (_x)->st_mtime; (_y)->tv_usec = 0; } while (0)
+# endif /* HAVE_ST_MTIMESPEC */
+#endif /* HAVE_ST_MTIM */
+
+/*
+ * Macros to quiet gcc's warn_unused_result attribute.
+ */
+#ifdef __GNUC__
+# define ignore_result(x) do { \
+ __typeof__(x) y = (x); \
+ (void)y; \
+} while(0)
+#else
+# define ignore_result(x) (void)(x)
+#endif
+
/* aix.c */
void aix_prep_user(char *user, const char *tty);
void aix_restoreauthdb(void);