Add BSD guard for time_t
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
This commit is contained in:
parent
f18eebf797
commit
5d0c2b87c8
|
@ -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 {
|
||||||
|
|
|
@ -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 */
|
||||||
|
|
|
@ -148,7 +148,9 @@ typedef void *_iconv_t;
|
||||||
#define _CLOCK_T_ unsigned long /* clock() */
|
#define _CLOCK_T_ unsigned long /* clock() */
|
||||||
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
|
||||||
|
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue