sys: Fix pthread includes to support avr-libs

Missing malloc.h and clock_id_t were causing issues to build.

It was tested with this configuration:

- linux ubuntu 14.04.5
- arduino-mega2560 board
- avr-libc-1.8.0-4.1

This change was needed to build iotivity example

Bug: https://github.com/RIOT-OS/RIOT/issues/6241
Change-Id: I82ce246093b3467dfe9746f999bcc9335dbb65f6
Signed-off-by: Philippe Coval <philippe.coval@osg.samsung.com>
This commit is contained in:
Philippe Coval 2016-11-07 19:49:09 +01:00
parent 78c3c29677
commit 20c3aaa448
4 changed files with 13 additions and 4 deletions

View File

@ -22,6 +22,10 @@
#include <time.h> #include <time.h>
#ifndef __WITH_AVRLIBC__
#define HAVE_MALLOC_H 1
#endif
#include "mutex.h" #include "mutex.h"
#include "sched.h" #include "sched.h"

View File

@ -25,7 +25,7 @@
# include "msp430_types.h" # include "msp430_types.h"
#endif #endif
#if defined(__MACH__) #if defined(__MACH__) || defined(__WITH_AVRLIBC__)
typedef int clockid_t; typedef int clockid_t;
#endif #endif

View File

@ -19,7 +19,6 @@
* @} * @}
*/ */
#include <malloc.h>
#include <stdbool.h> #include <stdbool.h>
#include <stddef.h> #include <stddef.h>
#include <string.h> #include <string.h>
@ -34,6 +33,10 @@
#include "pthread.h" #include "pthread.h"
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
#define ENABLE_DEBUG (0) #define ENABLE_DEBUG (0)
#if ENABLE_DEBUG #if ENABLE_DEBUG

View File

@ -16,10 +16,12 @@
* @} * @}
*/ */
#include <malloc.h>
#include "pthread.h" #include "pthread.h"
#ifdef HAVE_MALLOC_H
#include <malloc.h>
#endif
#define ENABLE_DEBUG (0) #define ENABLE_DEBUG (0)
#include "debug.h" #include "debug.h"