This is the mail archive of the newlib@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[RFA] confine _TIMEVAL_DEFINED guard in libc/include/sys/time.h


The _TIMEVAL_DEFINED guard in time.h is a little to enthusiastic in what
it is guarding.  It's possible that there are other guards needed here
but, IMO, _TIMEVAL_DEFINED shouldn't be turning off the declaration of
timezone.  Without this change, using Mingw64 headers becomes
problematic.

Ok to apply?

cgf

2012-11-11  Christopher Faylor  <me.newlib2012@cgf.cx>

        * libc/include/sys/time.h: Avoid guarding other than timeval
        declaration with _TIMEVAL_DEFINED.

Index: libc/include/sys/time.h
===================================================================
RCS file: /cvs/uberbaum/newlib/libc/include/sys/time.h,v
retrieving revision 1.16
diff -d -u -p -r1.16 time.h
--- libc/include/sys/time.h	8 Aug 2012 11:04:16 -0000	1.16
+++ libc/include/sys/time.h	11 Nov 2012 18:57:24 -0000
@@ -18,6 +18,7 @@ struct timeval {
   time_t      tv_sec;
   suseconds_t tv_usec;
 };
+#endif /* !_TIMEVAL_DEFINED */
 
 struct timezone {
   int tz_minuteswest;
@@ -28,8 +29,6 @@ struct timezone {
 #include <cygwin/sys_time.h>
 #endif /* __CYGWIN__ */
 
-#endif /* !_TIMEVAL_DEFINED */
-
 #define ITIMER_REAL     0
 #define ITIMER_VIRTUAL  1
 #define ITIMER_PROF     2


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]