From daf9f1102473b6d9ab95b49f247a6944b8e3289d Mon Sep 17 00:00:00 2001 From: Kumar Gala Date: Tue, 6 Aug 2019 15:43:38 -0500 Subject: [PATCH] lib/libc/min: Handle duplicate time definitions time_t and suseconds_t are defined in time.h and sys/types.h. Handle the duplication by adding ifdef protection around them similar to what is being done for other types. Signed-off-by: Kumar Gala --- lib/libc/minimal/include/sys/types.h | 7 +++++++ lib/libc/minimal/include/time.h | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/lib/libc/minimal/include/sys/types.h b/lib/libc/minimal/include/sys/types.h index 919e4a8e369..d06d5087818 100644 --- a/lib/libc/minimal/include/sys/types.h +++ b/lib/libc/minimal/include/sys/types.h @@ -42,8 +42,15 @@ typedef int off_t; #endif +#if !defined(__time_t_defined) +#define __time_t_defined typedef int64_t time_t; +#endif + +#if !defined(__suseconds_t_defined) +#define __suseconds_t_defined typedef int32_t suseconds_t; +#endif #if !defined(__mem_word_t_defined) #define __mem_word_t_defined diff --git a/lib/libc/minimal/include/time.h b/lib/libc/minimal/include/time.h index 918ef864934..2a81f9998bf 100644 --- a/lib/libc/minimal/include/time.h +++ b/lib/libc/minimal/include/time.h @@ -31,8 +31,15 @@ struct tm { int tm_isdst; }; +#if !defined(__time_t_defined) +#define __time_t_defined typedef int64_t time_t; +#endif + +#if !defined(__suseconds_t_defined) +#define __suseconds_t_defined typedef int32_t suseconds_t; +#endif #include