Add BSD guard for time_t

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
This commit is contained in:
Sebastian Huber 2016-04-15 13:44:17 +02:00 committed by Corinna Vinschen
parent f18eebf797
commit 5d0c2b87c8
6 changed files with 19 additions and 12 deletions

View File

@ -36,9 +36,10 @@
#include <sys/_types.h> #include <sys/_types.h>
#ifndef __time_t_defined #if !defined(__time_t_defined) && !defined(_TIME_T_DECLARED)
typedef _TIME_T_ time_t; typedef _TIME_T_ time_t;
#define __time_t_defined #define __time_t_defined
#define _TIME_T_DECLARED
#endif #endif
struct timespec { struct timespec {

View File

@ -36,9 +36,10 @@ typedef __suseconds_t suseconds_t;
#define _SUSECONDS_T_DECLARED #define _SUSECONDS_T_DECLARED
#endif #endif
#ifndef __time_t_defined #if !defined(__time_t_defined) && !defined(_TIME_T_DECLARED)
typedef _TIME_T_ time_t; typedef _TIME_T_ time_t;
#define __time_t_defined #define __time_t_defined
#define _TIME_T_DECLARED
#endif #endif
/* This define is also used outside of Newlib, e.g. in MinGW-w64 */ /* This define is also used outside of Newlib, e.g. in MinGW-w64 */

View File

@ -149,6 +149,8 @@ typedef void *_iconv_t;
typedef _CLOCK_T_ __clock_t; typedef _CLOCK_T_ __clock_t;
#define _TIME_T_ long /* time() */ #define _TIME_T_ long /* time() */
typedef _TIME_T_ __time_t;
#define _CLOCKID_T_ unsigned long #define _CLOCKID_T_ unsigned long
#define _TIMER_T_ unsigned long #define _TIMER_T_ unsigned long

View File

@ -17,9 +17,10 @@ extern "C" {
#include <_ansi.h> #include <_ansi.h>
#include <sys/_types.h> #include <sys/_types.h>
#ifndef __time_t_defined #if !defined(__time_t_defined) && !defined(_TIME_T_DECLARED)
typedef _TIME_T_ time_t; typedef _TIME_T_ time_t;
#define __time_t_defined #define __time_t_defined
#define _TIME_T_DECLARED
#endif #endif
struct timeb struct timeb

View File

@ -102,9 +102,10 @@ typedef _CLOCK_T_ clock_t;
#define _CLOCK_T_DECLARED #define _CLOCK_T_DECLARED
#endif #endif
#ifndef __time_t_defined #if !defined(__time_t_defined) && !defined(_TIME_T_DECLARED)
typedef _TIME_T_ time_t; typedef _TIME_T_ time_t;
#define __time_t_defined #define __time_t_defined
#define _TIME_T_DECLARED
#endif #endif
#ifndef __daddr_t_defined #ifndef __daddr_t_defined

View File

@ -3,9 +3,10 @@
#include <sys/_types.h> #include <sys/_types.h>
#ifndef __time_t_defined #if !defined(__time_t_defined) && !defined(_TIME_T_DECLARED)
typedef _TIME_T_ time_t; typedef _TIME_T_ time_t;
#define __time_t_defined #define __time_t_defined
#define _TIME_T_DECLARED
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus