OSDN Git Service

* rtl.h (mem_attrs): Rename decl to expr; adjust all users.
[pf3gnuchains/gcc-fork.git] / gcc / ada / cio.c
1 /****************************************************************************
2  *                                                                          *
3  *                         GNAT COMPILER COMPONENTS                         *
4  *                                                                          *
5  *                                  C I O                                   *
6  *                                                                          *
7  *                          C Implementation File                           *
8  *                                                                          *
9  *                            $Revision$
10  *                                                                          *
11  *          Copyright (C) 1992-2001 Free Software Foundation, Inc.          *
12  *                                                                          *
13  * GNAT is free software;  you can  redistribute it  and/or modify it under *
14  * terms of the  GNU General Public License as published  by the Free Soft- *
15  * ware  Foundation;  either version 2,  or (at your option) any later ver- *
16  * sion.  GNAT is distributed in the hope that it will be useful, but WITH- *
17  * OUT ANY WARRANTY;  without even the  implied warranty of MERCHANTABILITY *
18  * or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License *
19  * for  more details.  You should have  received  a copy of the GNU General *
20  * Public License  distributed with GNAT;  see file COPYING.  If not, write *
21  * to  the Free Software Foundation,  59 Temple Place - Suite 330,  Boston, *
22  * MA 02111-1307, USA.                                                      *
23  *                                                                          *
24  * As a  special  exception,  if you  link  this file  with other  files to *
25  * produce an executable,  this file does not by itself cause the resulting *
26  * executable to be covered by the GNU General Public License. This except- *
27  * ion does not  however invalidate  any other reasons  why the  executable *
28  * file might be covered by the  GNU Public License.                        *
29  *                                                                          *
30  * GNAT was originally developed  by the GNAT team at  New York University. *
31  * It is now maintained by Ada Core Technologies Inc (http://www.gnat.com). *
32  *                                                                          *
33  ****************************************************************************/
34
35 #ifdef IN_RTS
36 #include "tconfig.h"
37 #include "tsystem.h"
38 #include <sys/stat.h>
39 #else
40 #include "config.h"
41 #include "system.h"
42 #endif
43
44 #include "adaint.h"
45
46 #ifdef __RT__
47
48 /* Linux kernel modules don't have inputs, so don't define get_int.
49    Simple output can be done via printk. */
50
51 void
52 put_char (c)
53      int c;
54 {
55   printk ("%c", c);
56 }
57
58 void
59 put_char_stderr (c)
60      int c;
61 {
62   put_char (c);
63 }
64
65 void
66 put_int (x)
67      int x;
68 {
69   printk ("%d", x);
70 }
71
72 void
73 put_int_stderr (int x)
74 {
75   put_int (x);
76 }
77
78 #else
79
80 /* Don't use macros on GNU/Linux since they cause incompatible changes between
81    glibc 2.0 and 2.1 */
82 #ifdef linux
83 #undef putchar
84 #undef getchar
85 #undef fputc
86 #undef stderr
87 #endif
88
89 int
90 get_char ()
91 {
92 #ifdef VMS
93   return decc$getchar();
94 #else
95   return getchar ();
96 #endif
97 }
98
99 int
100 get_int ()
101 {
102   int x;
103
104   scanf (" %d", &x);
105   return x;
106 }
107
108 void
109 put_int (x)
110      int x;
111 {
112   printf ("%d", x);
113 }
114
115 void
116 put_int_stderr (x)
117    int x;
118 {
119   fprintf (stderr, "%d", x);
120 }
121
122 void
123 put_char (c)
124      int c;
125 {
126   putchar (c);
127 }
128
129 void
130 put_char_stderr (c)
131      int c;
132 {
133   fputc (c, stderr);
134 }
135 #endif
136
137 #ifdef __vxworks
138
139 char *
140 mktemp (template)
141      char *template;
142 {
143   return tmpnam (NULL);
144 }
145 #endif