Newlib uses <timespec.h> and <_timespec.h> headers for defining itimerspec and
timespec types, respectively. However, these definitions are not protected with
preprocessing guards in case they were previously defined, which happens for us
because we define these types in uktime internal lib. Therefore the solution is
to skip using newlib's headers and provide our own.
Signed-off-by: Costin Lupu <costin.lupu@cs.pub.ro>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
--- /dev/null
+#ifndef __NEWLIB_GLUE_SYS__TIMESPEC_H__
+#define __NEWLIB_GLUE_SYS__TIMESPEC_H__
+
+#include <uk/_timespec.h>
+
+#endif /* __NEWLIB_GLUE_SYS__TIMESPEC_H__ */
--- /dev/null
+#ifndef __NEWLIB_GLUE_SYS_TIMESPEC_H__
+#define __NEWLIB_GLUE_SYS_TIMESPEC_H__
+
+#include <uk/_timespec.h>
+
+#endif /* __NEWLIB_GLUE_SYS_TIMESPEC_H__ */
--- /dev/null
+#ifndef __NEWLIB_GLUE_UK__TIMESPEC_H__
+#define __NEWLIB_GLUE_UK__TIMESPEC_H__
+
+#define __NEED_time_t
+#define __NEED_struct_timespec
+#include <uk/time_types.h>
+
+/* newlib guards */
+#define __time_t_defined
+
+#endif /* __NEWLIB_GLUE_UK__TIMESPEC_H__ */