From: Roy Marples Date: Wed, 8 Jan 2020 00:43:11 +0000 (+0000) Subject: eloop: header is now the single source of truth for SEC_PER_SEC X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c78e7c00862f01808aaa37db1b8396b0844d2b0d;p=thirdparty%2Fdhcpcd.git eloop: header is now the single source of truth for SEC_PER_SEC Saves duplication --- diff --git a/src/common.h b/src/common.h index 9d41a48a..1d6f1722 100644 --- a/src/common.h +++ b/src/common.h @@ -51,11 +51,6 @@ #define ROUNDUP4(a) (1 + (((a) - 1) | 3)) #define ROUNDUP8(a) (1 + (((a) - 1) | 7)) -#define NSEC_PER_SEC 1000000000L -#define MSEC_PER_SEC 1000 -#define CSEC_PER_SEC 100L -#define NSEC_PER_CSEC 10000000L - /* Some systems don't define timespec macros */ #ifndef timespecclear #define timespecclear(tsp) (tsp)->tv_sec = (time_t)((tsp)->tv_nsec = 0L) diff --git a/src/eloop.c b/src/eloop.c index 5a710aec..6e988c84 100644 --- a/src/eloop.c +++ b/src/eloop.c @@ -95,12 +95,6 @@ #endif #endif -#ifndef MSEC_PER_SEC -#define MSEC_PER_SEC 1000 -#define NSEC_PER_MSEC 1000000L -#define NSEC_PER_SEC 1000000000U -#endif - #if defined(HAVE_KQUEUE) #include #include diff --git a/src/eloop.h b/src/eloop.h index ea608189..c4942131 100644 --- a/src/eloop.h +++ b/src/eloop.h @@ -31,6 +31,13 @@ #include +/* Handy macros to create subsecond timeouts */ +#define CSEC_PER_SEC 100 +#define MSEC_PER_SEC 1000 +#define NSEC_PER_CSEC 10000000 +#define NSEC_PER_MSEC 1000000 +#define NSEC_PER_SEC 1000000000 + /* eloop queues are really only for deleting timeouts registered * for a function or object. * The idea being that one interface has different timeouts for