This commit is contained in:
Roy Marples 2009-04-23 20:53:24 +00:00
parent d231a2f0d9
commit 6953474655

View File

@ -1,7 +1,7 @@
/* /*
rc-misc.h rc-misc.h
This is private to us and not for user consumption This is private to us and not for user consumption
*/ */
/* /*
* Copyright 2007-2009 Roy Marples <roy@marples.name> * Copyright 2007-2009 Roy Marples <roy@marples.name>
@ -75,7 +75,7 @@
(head1)->tqh_last = (head2)->tqh_last; \ (head1)->tqh_last = (head2)->tqh_last; \
TAILQ_INIT((head2)); \ TAILQ_INIT((head2)); \
} \ } \
} while (0) } while (0)
#endif #endif
#ifndef TAILQ_FOREACH_SAFE #ifndef TAILQ_FOREACH_SAFE
@ -91,6 +91,18 @@
# endif # endif
#endif #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 (/* CONSTCOND */ 0)
#endif
_unused static void *xmalloc (size_t size) _unused static void *xmalloc (size_t size)
{ {
void *value = malloc(size); void *value = malloc(size);