diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2016-04-15 13:44:16 +0200 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2016-04-15 14:51:39 +0200 |
commit | f18eebf7979d309caae993c8a91daeab7881a206 (patch) | |
tree | e19734f8913ba755ba890939657b3ca33f31dd9c /newlib/libc | |
parent | eba91a5d0a6cb277fde8bb961fcb0462e5163227 (diff) | |
download | cygnal-f18eebf7979d309caae993c8a91daeab7881a206.tar.gz cygnal-f18eebf7979d309caae993c8a91daeab7881a206.tar.bz2 cygnal-f18eebf7979d309caae993c8a91daeab7881a206.zip |
Add BSD guard for clock_t
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
Diffstat (limited to 'newlib/libc')
-rw-r--r-- | newlib/libc/include/sys/_types.h | 4 | ||||
-rw-r--r-- | newlib/libc/include/sys/times.h | 7 | ||||
-rw-r--r-- | newlib/libc/include/sys/types.h | 7 |
3 files changed, 11 insertions, 7 deletions
diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h index 951428940..7102a4fa0 100644 --- a/newlib/libc/include/sys/_types.h +++ b/newlib/libc/include/sys/_types.h @@ -145,7 +145,9 @@ typedef _LOCK_RECURSIVE_T _flock_t; typedef void *_iconv_t; #endif -#define _CLOCK_T_ unsigned long /* clock() */ +#define _CLOCK_T_ unsigned long /* clock() */ +typedef _CLOCK_T_ __clock_t; + #define _TIME_T_ long /* time() */ #define _CLOCKID_T_ unsigned long #define _TIMER_T_ unsigned long diff --git a/newlib/libc/include/sys/times.h b/newlib/libc/include/sys/times.h index dc072f464..b1f1dc699 100644 --- a/newlib/libc/include/sys/times.h +++ b/newlib/libc/include/sys/times.h @@ -7,9 +7,10 @@ extern "C" { #include <_ansi.h> #include <sys/_types.h> -#ifndef __clock_t_defined -typedef _CLOCK_T_ clock_t; -#define __clock_t_defined +#if !defined(__clock_t_defined) && !defined(_CLOCK_T_DECLARED) +typedef _CLOCK_T_ clock_t; +#define __clock_t_defined +#define _CLOCK_T_DECLARED #endif /* Get Process Times, P1003.1b-1993, p. 92 */ diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h index e48c2f256..f17821bce 100644 --- a/newlib/libc/include/sys/types.h +++ b/newlib/libc/include/sys/types.h @@ -96,9 +96,10 @@ typedef unsigned int uint; /* System V compatibility */ typedef unsigned long ulong; /* System V compatibility */ #endif -#ifndef __clock_t_defined -typedef _CLOCK_T_ clock_t; -#define __clock_t_defined +#if !defined(__clock_t_defined) && !defined(_CLOCK_T_DECLARED) +typedef _CLOCK_T_ clock_t; +#define __clock_t_defined +#define _CLOCK_T_DECLARED #endif #ifndef __time_t_defined |