summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/helper/jim-eventloop.c1
-rw-r--r--src/helper/replacements.h9
-rw-r--r--src/jtag/jtag.c7
3 files changed, 14 insertions, 3 deletions
diff --git a/src/helper/jim-eventloop.c b/src/helper/jim-eventloop.c
index 62513704..d0b3ff01 100644
--- a/src/helper/jim-eventloop.c
+++ b/src/helper/jim-eventloop.c
@@ -62,6 +62,7 @@
#include <sys/time.h>
#include <sys/types.h>
#include <unistd.h>
+#include <stdio.h>
#include <errno.h>
#include "replacements.h"
diff --git a/src/helper/replacements.h b/src/helper/replacements.h
index 2725d945..8e1e51d0 100644
--- a/src/helper/replacements.h
+++ b/src/helper/replacements.h
@@ -35,7 +35,14 @@
#if BUILD_ECOSBOARD
#include <pkgconf/system.h>
#include <stdlib.h>
-#include <sys/select.h>
+#endif
+
+#ifdef HAVE_SYS_SELECT_H
+#include <sys/select.h> /* select, FD_SET and friends (POSIX.1-2001) */
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h> /* FD_SET and friends (pre-POSIX.1-2001) */
#endif
/* include necessary headers for socket functionality */
diff --git a/src/jtag/jtag.c b/src/jtag/jtag.c
index 91d08638..c1e2648b 100644
--- a/src/jtag/jtag.c
+++ b/src/jtag/jtag.c
@@ -35,9 +35,12 @@
#include "command.h"
#include "log.h"
-#include "stdlib.h"
-#include "string.h"
+#include <stdlib.h>
+#include <string.h>
#include <unistd.h>
+#ifdef HAVE_STRINGS_H
+#include <strings.h>
+#endif
/* note that this is not marked as static as it must be available from outside jtag.c for those
that implement the jtag_xxx() minidriver layer