cfgexpand: Update partition size when merging variables
[official-gcc.git] / gcc / ada / cio.c
blob7fca41285c0d9afe1b07db746435c3b05a322220
1 /****************************************************************************
2 * *
3 * GNAT COMPILER COMPONENTS *
4 * *
5 * C I O *
6 * *
7 * C Implementation File *
8 * *
9 * Copyright (C) 1992-2019, Free Software Foundation, Inc. *
10 * *
11 * GNAT is free software; you can redistribute it and/or modify it under *
12 * terms of the GNU General Public License as published by the Free Soft- *
13 * ware Foundation; either version 3, or (at your option) any later ver- *
14 * sion. GNAT is distributed in the hope that it will be useful, but WITH- *
15 * OUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY *
16 * or FITNESS FOR A PARTICULAR PURPOSE. *
17 * *
18 * As a special exception under Section 7 of GPL version 3, you are granted *
19 * additional permissions described in the GCC Runtime Library Exception, *
20 * version 3.1, as published by the Free Software Foundation. *
21 * *
22 * You should have received a copy of the GNU General Public License and *
23 * a copy of the GCC Runtime Library Exception along with this program; *
24 * see the files COPYING3 and COPYING.RUNTIME respectively. If not, see *
25 * <http://www.gnu.org/licenses/>. *
26 * *
27 * GNAT was originally developed by the GNAT team at New York University. *
28 * Extensive contributions were provided by Ada Core Technologies Inc. *
29 * *
30 ****************************************************************************/
32 #ifdef IN_RTS
33 #include "runtime.h"
34 #include <sys/stat.h>
35 #else
36 #include "config.h"
37 #include "system.h"
38 #endif
40 #include "adaint.h"
42 /* We need L_tmpnam definition */
43 #include <stdio.h>
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
49 /* Don't use macros on GNU/Linux since they cause incompatible changes between
50 glibc 2.0 and 2.1 */
51 #ifdef __linux__
52 #undef putchar
53 #undef getchar
54 #undef fputc
55 #undef stderr
56 #undef stdout
57 #endif
59 /* Don't use macros versions of this functions on VxWorks since they cause
60 imcompatible changes in some VxWorks versions */
61 #ifdef __vxworks
62 #undef getchar
63 #undef putchar
64 #undef feof
65 #undef ferror
66 #undef fileno
67 #endif
69 #ifdef RTX
70 #include <windows.h>
71 #include <Rtapi.h>
72 #endif
74 int
75 get_char (void)
77 #ifdef VMS
78 return decc$getchar();
79 #else
80 return getchar ();
81 #endif
84 int
85 get_int (void)
87 int x;
89 scanf (" %d", &x);
90 return x;
93 void
94 put_int (int x)
96 #ifdef RTX
97 RtPrintf ("%d", x);
98 #else
99 /* Use fprintf rather than printf, since the latter is unbuffered
100 on vxworks */
101 fprintf (stdout, "%d", x);
102 #endif
105 void
106 put_int_stderr (int x)
108 #ifdef RTX
109 RtPrintf ("%d", x);
110 #else
111 fprintf (stderr, "%d", x);
112 #endif
115 void
116 put_char (int c)
118 #ifdef RTX
119 RtPrintf ("%c", c);
120 #else
121 putchar (c);
122 #endif
125 void
126 put_char_stderr (int c)
128 #ifdef RTX
129 RtPrintf ("%c", c);
130 #else
131 fputc (c, stderr);
132 #endif
135 #ifdef __vxworks
137 char *
138 mktemp (char *template)
140 #if !(defined (__RTP__) || defined (VTHREADS))
141 static char buf[L_tmpnam]; /* Internal buffer for name */
143 /* If parameter is NULL use internal buffer */
144 if (template == NULL)
145 template = buf;
147 __gnat_tmp_name (template);
148 return template;
149 #else
150 return tmpnam (NULL);
151 #endif
153 #endif
155 #ifdef __cplusplus
157 #endif