pthread_cond.h: use 'sys/types.h' value of 'clockid_t' for avr

This enables 'pthread' support on arduino.

avr-libc C90 'time.h' does not include 'sys/types.h' as POSIX expects it.
However, the type previously defined conflicts with the one in
'cpu/atmega_common/avr_libc_extra/include/sys/types.h' when both are
included, so include 'sys/types.h'.

Maybe it should alway be included by 'time.h' but this
would need its specific review.
This commit is contained in:
Gaëtan Harter 2019-09-11 17:07:06 +02:00
parent 00e0a1cf13
commit 624957252e
No known key found for this signature in database
GPG Key ID: 76DF6BCF1B1F883B

View File

@ -25,14 +25,18 @@
# include "msp430_types.h"
#endif
#if defined(__WITH_AVRLIBC__)
/* avr-libc 'time.h' does not include 'sys/types.h' but we need 'clockid_t' */
# include <sys/types.h>
#endif
#ifdef __MACH__
/* needed for AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER */
#include <AvailabilityMacros.h>
#endif
#if defined(__WITH_AVRLIBC__) || (defined(__MACH__) && !defined(AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER))
#if !defined(AVAILABLE_MAC_OS_X_VERSION_10_12_AND_LATER)
typedef int clockid_t;
#endif
#endif
#ifdef __cplusplus
extern "C" {