Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-04-15 14:44:17 +0300
committerCorinna Vinschen <corinna@vinschen.de>2016-04-15 15:51:39 +0300
commit5d0c2b87c87ff6a5ec150b8b1615dc4e23539e3a (patch)
tree269e97afdcfdaa670b0f10602324799cc42585a6
parentf18eebf7979d309caae993c8a91daeab7881a206 (diff)
Add BSD guard for time_t
Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
-rw-r--r--newlib/libc/include/sys/_timespec.h3
-rw-r--r--newlib/libc/include/sys/_timeval.h3
-rw-r--r--newlib/libc/include/sys/_types.h4
-rw-r--r--newlib/libc/include/sys/timeb.h7
-rw-r--r--newlib/libc/include/sys/types.h7
-rw-r--r--newlib/libc/sys/sparc64/sys/_timeval.h7
6 files changed, 19 insertions, 12 deletions
diff --git a/newlib/libc/include/sys/_timespec.h b/newlib/libc/include/sys/_timespec.h
index 4a7aabcb1..7609e4a46 100644
--- a/newlib/libc/include/sys/_timespec.h
+++ b/newlib/libc/include/sys/_timespec.h
@@ -36,9 +36,10 @@
#include <sys/_types.h>
-#ifndef __time_t_defined
+#if !defined(__time_t_defined) && !defined(_TIME_T_DECLARED)
typedef _TIME_T_ time_t;
#define __time_t_defined
+#define _TIME_T_DECLARED
#endif
struct timespec {
diff --git a/newlib/libc/include/sys/_timeval.h b/newlib/libc/include/sys/_timeval.h
index d813d1f5b..676a0b894 100644
--- a/newlib/libc/include/sys/_timeval.h
+++ b/newlib/libc/include/sys/_timeval.h
@@ -36,9 +36,10 @@ typedef __suseconds_t suseconds_t;
#define _SUSECONDS_T_DECLARED
#endif
-#ifndef __time_t_defined
+#if !defined(__time_t_defined) && !defined(_TIME_T_DECLARED)
typedef _TIME_T_ time_t;
#define __time_t_defined
+#define _TIME_T_DECLARED
#endif
/* This define is also used outside of Newlib, e.g. in MinGW-w64 */
diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h
index 7102a4fa0..1ba4c6469 100644
--- a/newlib/libc/include/sys/_types.h
+++ b/newlib/libc/include/sys/_types.h
@@ -148,7 +148,9 @@ typedef void *_iconv_t;
#define _CLOCK_T_ unsigned long /* clock() */
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 _TIMER_T_ unsigned long
diff --git a/newlib/libc/include/sys/timeb.h b/newlib/libc/include/sys/timeb.h
index 264783050..793b48143 100644
--- a/newlib/libc/include/sys/timeb.h
+++ b/newlib/libc/include/sys/timeb.h
@@ -17,9 +17,10 @@ extern "C" {
#include <_ansi.h>
#include <sys/_types.h>
-#ifndef __time_t_defined
-typedef _TIME_T_ time_t;
-#define __time_t_defined
+#if !defined(__time_t_defined) && !defined(_TIME_T_DECLARED)
+typedef _TIME_T_ time_t;
+#define __time_t_defined
+#define _TIME_T_DECLARED
#endif
struct timeb
diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index f17821bce..2338cf50b 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -102,9 +102,10 @@ typedef _CLOCK_T_ clock_t;
#define _CLOCK_T_DECLARED
#endif
-#ifndef __time_t_defined
-typedef _TIME_T_ time_t;
-#define __time_t_defined
+#if !defined(__time_t_defined) && !defined(_TIME_T_DECLARED)
+typedef _TIME_T_ time_t;
+#define __time_t_defined
+#define _TIME_T_DECLARED
#endif
#ifndef __daddr_t_defined
diff --git a/newlib/libc/sys/sparc64/sys/_timeval.h b/newlib/libc/sys/sparc64/sys/_timeval.h
index fbe9ce64d..b0aaeda7e 100644
--- a/newlib/libc/sys/sparc64/sys/_timeval.h
+++ b/newlib/libc/sys/sparc64/sys/_timeval.h
@@ -3,9 +3,10 @@
#include <sys/_types.h>
-#ifndef __time_t_defined
-typedef _TIME_T_ time_t;
-#define __time_t_defined
+#if !defined(__time_t_defined) && !defined(_TIME_T_DECLARED)
+typedef _TIME_T_ time_t;
+#define __time_t_defined
+#define _TIME_T_DECLARED
#endif
#ifdef __cplusplus