diff options
author | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-03-28 00:00:13 +0000 |
---|---|---|
committer | Nicholas Marriott <nicholas.marriott@gmail.com> | 2013-03-28 00:00:13 +0000 |
commit | 64ea8829af8719c0dc1eb7c0d2c9933a7b3d6e04 (patch) | |
tree | 1e4f2c71d49ec7f802b505f294f7de51405c963d | |
parent | 629cfec8a3f9da2837a74f42d56143c11bc93b90 (diff) | |
download | rtmux-64ea8829af8719c0dc1eb7c0d2c9933a7b3d6e04.tar.gz rtmux-64ea8829af8719c0dc1eb7c0d2c9933a7b3d6e04.tar.bz2 rtmux-64ea8829af8719c0dc1eb7c0d2c9933a7b3d6e04.zip |
Add define for timersub to compat.h.
-rw-r--r-- | compat.h | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -152,6 +152,18 @@ typedef uint64_t u_int64_t; } while (0) #endif +#ifndef timersub +#define timersub(tvp, uvp, vvp) \ + do { \ + (vvp)->tv_sec = (tvp)->tv_sec - (uvp)->tv_sec; \ + (vvp)->tv_usec = (tvp)->tv_usec - (uvp)->tv_usec; \ + if ((vvp)->tv_usec < 0) { \ + (vvp)->tv_sec--; \ + (vvp)->tv_usec += 1000000; \ + } \ + } while (0) +#endif + #ifndef TTY_NAME_MAX #define TTY_NAME_MAX 32 #endif |