Add x prefix to v850e case for handling --with-cpu=v850e.
[official-gcc.git] / gcc / ada / cal.c
blob2737380bd40d398b24a08bf8911799cfbefd39a6
1 /****************************************************************************
2 * *
3 * GNAT COMPILER COMPONENTS *
4 * *
5 * C A L *
6 * *
7 * C Implementation File *
8 * *
9 * *
10 * Copyright (C) 1992-2001, Free Software Foundation, Inc. *
11 * *
12 * GNAT is free software; you can redistribute it and/or modify it under *
13 * terms of the GNU General Public License as published by the Free Soft- *
14 * ware Foundation; either version 2, or (at your option) any later ver- *
15 * sion. GNAT is distributed in the hope that it will be useful, but WITH- *
16 * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
17 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License *
18 * for more details. You should have received a copy of the GNU General *
19 * Public License distributed with GNAT; see file COPYING. If not, write *
20 * to the Free Software Foundation, 59 Temple Place - Suite 330, Boston, *
21 * MA 02111-1307, USA. *
22 * *
23 * As a special exception, if you link this file with other files to *
24 * produce an executable, this file does not by itself cause the resulting *
25 * executable to be covered by the GNU General Public License. This except- *
26 * ion does not however invalidate any other reasons why the executable *
27 * file might be covered by the GNU Public License. *
28 * *
29 * GNAT was originally developed by the GNAT team at New York University. *
30 * It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). *
31 * *
32 ****************************************************************************/
34 /* This file contains those routines named by Import pragmas in package */
35 /* GNAT.Calendar. It is used to to Duration to timeval convertion. */
36 /* These are simple wrappers function to abstarct the fact that the C */
37 /* struct timeval fields type are not normalized (they are generaly */
38 /* defined as int or long values). */
40 #if defined(VMS)
42 /* this is temporary code to avoid build failure under VMS */
44 void
45 __gnat_timeval_to_duration (void *t, long *sec, long *usec)
49 void
50 __gnat_duration_to_timeval (long sec, long usec, void *t)
54 #else
56 #if defined (__vxworks)
57 #include <sys/times.h>
58 #else
59 #include <sys/time.h>
60 #endif
62 void
63 __gnat_timeval_to_duration (struct timeval *t, long *sec, long *usec)
65 *sec = (long) t->tv_sec;
66 *usec = (long) t->tv_usec;
69 void
70 __gnat_duration_to_timeval (long sec, long usec, struct timeval *t)
72 /* here we are doing implicit convertion from a long to the struct timeval
73 fields types. */
75 t->tv_sec = sec;
76 t->tv_usec = usec;
78 #endif
80 #ifdef __alpha_vxworks
81 #include "vxWorks.h"
82 #elif defined (__vxworks)
83 #include <types/vxTypesOld.h>
84 #endif
86 /* Return the value of the "time" C library function. We always return
87 a long and do it this way to avoid problems with not knowing
88 what time_t is on the target. */
90 long
91 gnat_time ()
93 return time (0);