diff --git a/sys/posix/pthread/include/pthread.h b/sys/posix/pthread/include/pthread.h index 183e9ecb69..df5d5d6092 100644 --- a/sys/posix/pthread/include/pthread.h +++ b/sys/posix/pthread/include/pthread.h @@ -22,6 +22,10 @@ #include +#ifndef __WITH_AVRLIBC__ +#define HAVE_MALLOC_H 1 +#endif + #include "mutex.h" #include "sched.h" diff --git a/sys/posix/pthread/include/pthread_cond.h b/sys/posix/pthread/include/pthread_cond.h index ebbd54f731..5d34d50554 100644 --- a/sys/posix/pthread/include/pthread_cond.h +++ b/sys/posix/pthread/include/pthread_cond.h @@ -25,7 +25,7 @@ # include "msp430_types.h" #endif -#if defined(__MACH__) +#if defined(__MACH__) || defined(__WITH_AVRLIBC__) typedef int clockid_t; #endif diff --git a/sys/posix/pthread/pthread.c b/sys/posix/pthread/pthread.c index dd7cbdf5a7..64d72ec261 100644 --- a/sys/posix/pthread/pthread.c +++ b/sys/posix/pthread/pthread.c @@ -19,7 +19,6 @@ * @} */ -#include #include #include #include @@ -34,6 +33,10 @@ #include "pthread.h" +#ifdef HAVE_MALLOC_H +#include +#endif + #define ENABLE_DEBUG (0) #if ENABLE_DEBUG diff --git a/sys/posix/pthread/pthread_tls.c b/sys/posix/pthread/pthread_tls.c index 028d132074..dbd272f3c8 100644 --- a/sys/posix/pthread/pthread_tls.c +++ b/sys/posix/pthread/pthread_tls.c @@ -16,10 +16,12 @@ * @} */ -#include - #include "pthread.h" +#ifdef HAVE_MALLOC_H +#include +#endif + #define ENABLE_DEBUG (0) #include "debug.h"