Browse Source

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>
pr/spi.typo
Philippe Coval 6 years ago
parent
commit
20c3aaa448
  1. 4
      sys/posix/pthread/include/pthread.h
  2. 2
      sys/posix/pthread/include/pthread_cond.h
  3. 5
      sys/posix/pthread/pthread.c
  4. 6
      sys/posix/pthread/pthread_tls.c

4
sys/posix/pthread/include/pthread.h

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

2
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

5
sys/posix/pthread/pthread.c

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

6
sys/posix/pthread/pthread_tls.c

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

Loading…
Cancel
Save