[Ada] Fix timeval on vxworks 6.2

Arnaud Charlet charlet@adacore.com
Tue Oct 31 19:45:00 GMT 2006


Tested on i686-linux, committed on trunk.

The definition of timeval was in time.h for VxWorks 6.0, but it has been
moved to sys/time.h in VxWorks 6.2.

2006-10-31  Jose Ruiz  <ruiz@adacore.com>

	* cal.c: Use the header sys/time.h for VxWorks 6.2 or greater when
	using RTPs.

	* mkdir.c: Use a different version of mkdir for VxWorks 6.2 or greater
	when using RTPs.

-------------- next part --------------
Index: cal.c
===================================================================
--- cal.c	(revision 118179)
+++ cal.c	(working copy)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *          Copyright (C) 1992-2005, Free Software Foundation, Inc.         *
+ *          Copyright (C) 1992-2006, Free Software Foundation, Inc.         *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
@@ -55,6 +55,10 @@ __gnat_duration_to_timeval (long sec, lo
 #if defined (__vxworks)
 #ifdef __RTP__
 #include <time.h>
+#include <version.h>
+#if (_WRS_VXWORKS_MINOR != 0)
+#include <sys/time.h>
+#endif
 #else
 #include <sys/times.h>
 #endif
Index: mkdir.c
===================================================================
--- mkdir.c	(revision 118179)
+++ mkdir.c	(working copy)
@@ -6,7 +6,7 @@
  *                                                                          *
  *                          C Implementation File                           *
  *                                                                          *
- *             Copyright (C) 2002-2003, Free Software Foundation, Inc.      *
+ *             Copyright (C) 2002-2006, Free Software Foundation, Inc.      *
  *                                                                          *
  * GNAT is free software;  you can  redistribute it  and/or modify it under *
  * terms of the  GNU General Public License as published  by the Free Soft- *
@@ -32,6 +32,7 @@
 
 #ifdef __vxworks
 #include "vxWorks.h"
+#include <version.h>
 #endif /* __vxworks */
 
 #ifdef IN_RTS
@@ -50,7 +51,8 @@
 int
 __gnat_mkdir (char *dir_name)
 {
-#if defined (_WIN32) || defined (__vxworks)
+#if defined (_WIN32) || (defined (__vxworks) \
+                         && !(defined (__RTP__) && (_WRS_VXWORKS_MINOR != 0)))
   return mkdir (dir_name);
 #else
   return mkdir (dir_name, S_IRWXU | S_IRWXG | S_IRWXO);


More information about the Gcc-patches mailing list