Remove some compile time warnings about duplicate definitions.
[official-gcc.git] / gcc / ada / cio.c
blob65a78698579a9726cf4ba430c48977f83341409b
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 ****************************************************************************/
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
44 #include "adaint.h"
46 #ifdef __RT__
48 /* Linux kernel modules don't have inputs, so don't define get_int.
49 Simple output can be done via printk. */
51 void
52 put_char (c)
53 int c;
55 printk ("%c", c);
58 void
59 put_char_stderr (c)
60 int c;
62 put_char (c);
65 void
66 put_int (x)
67 int x;
69 printk ("%d", x);
72 void
73 put_int_stderr (int x)
75 put_int (x);
78 #else
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
89 int
90 get_char ()
92 #ifdef VMS
93 return decc$getchar();
94 #else
95 return getchar ();
96 #endif
99 int
100 get_int ()
102 int x;
104 scanf (" %d", &x);
105 return x;
108 void
109 put_int (x)
110 int x;
112 printf ("%d", x);
115 void
116 put_int_stderr (x)
117 int x;
119 fprintf (stderr, "%d", x);
122 void
123 put_char (c)
124 int c;
126 putchar (c);
129 void
130 put_char_stderr (c)
131 int c;
133 fputc (c, stderr);
135 #endif
137 #ifdef __vxworks
139 char *
140 mktemp (template)
141 char *template;
143 return tmpnam (NULL);
145 #endif