Skip to content
Snippets Groups Projects
Commit 0a5a512c authored by Tommy Olofsson's avatar Tommy Olofsson
Browse files

Undo more unnecc. changes.

parent 1464b736
No related branches found
No related tags found
No related merge requests found
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
*/ */
#include <errno.h> #include <errno.h>
#include <unistd.h>
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "labcomm2014_private.h" #include "labcomm2014_private.h"
......
...@@ -20,6 +20,7 @@ ...@@ -20,6 +20,7 @@
*/ */
#include <errno.h> #include <errno.h>
#include <unistd.h>
#include <string.h> #include <string.h>
#include <stdlib.h> #include <stdlib.h>
#include <stdarg.h> #include <stdarg.h>
......
...@@ -22,17 +22,21 @@ ...@@ -22,17 +22,21 @@
#include <errno.h> #include <errno.h>
#include "labcomm2014_scheduler_private.h" #include "labcomm2014_scheduler_private.h"
#define TIME_time(time, ...) time
#define TIME(func, ...) \
if (TIME_time(__VA_ARGS__) && \
TIME_time(__VA_ARGS__)->action->func) { \
return TIME_time(__VA_ARGS__)->action->func(__VA_ARGS__); \
} \
return -ENOSYS;
int labcomm2014_time_free(struct labcomm2014_time *s) int labcomm2014_time_free(struct labcomm2014_time *s)
{ {
if (s && s->action->free) TIME(free, s);
return s->action->free(s);
return -ENOSYS;
} }
int labcomm2014_time_add_usec(struct labcomm2014_time *s, uint32_t usec) int labcomm2014_time_add_usec(struct labcomm2014_time *s, uint32_t usec)
{ {
if (s && s->action->add_usec) TIME(add_usec, s, usec);
return s->action->add_usec(s, usec);
return -ENOSYS;
} }
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment