Skip to content
Permalink
Browse files

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 <kumar.gala@linaro.org>
  • Loading branch information...
galak authored and andrewboie committed Aug 6, 2019
1 parent b711c1e commit daf9f1102473b6d9ab95b49f247a6944b8e3289d
Showing with 14 additions and 0 deletions.
  1. +7 −0 lib/libc/minimal/include/sys/types.h
  2. +7 −0 lib/libc/minimal/include/time.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
@@ -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 <sys/_timespec.h>

0 comments on commit daf9f11

Please sign in to comment.
You can’t perform that action at this time.