ansilove

ANSI and ASCII art to PNG converter in C
Log | Files | Refs | README | LICENSE

commit 1366af743279eb94c597236182bf92737f4fbaab
parent affed292808d4819ac6e9c2b3a2ca3a1d6842968
Author: Frederic Cambus <fred@statdns.com>
Date:   Sun, 24 May 2020 10:32:09 +0200

Define timespecsub macro in compat.h if it doesn't exists.

Diffstat:
Mcompat/compat.h | 12++++++++++++
1 file changed, 12 insertions(+), 0 deletions(-)

diff --git a/compat/compat.h b/compat/compat.h @@ -9,4 +9,16 @@ #include "strtonum.h" #endif +#ifndef timespecsub +#define timespecsub(tsp, usp, vsp) \ + do { \ + (vsp)->tv_sec = (tsp)->tv_sec - (usp)->tv_sec; \ + (vsp)->tv_nsec = (tsp)->tv_nsec - (usp)->tv_nsec; \ + if ((vsp)->tv_nsec < 0) { \ + (vsp)->tv_sec--; \ + (vsp)->tv_nsec += 1000000000L; \ + } \ + } while (0) +#endif + #endif /* COMPAT_H */