summaryrefslogtreecommitdiff
path: root/contrib/bison/allocate.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/bison/allocate.c')
-rw-r--r--contrib/bison/allocate.c34
1 files changed, 25 insertions, 9 deletions
diff --git a/contrib/bison/allocate.c b/contrib/bison/allocate.c
index a74dc1829767..fdc83856fdc9 100644
--- a/contrib/bison/allocate.c
+++ b/contrib/bison/allocate.c
@@ -15,20 +15,38 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Bison; see the file COPYING. If not, write to
-the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
+Boston, MA 02111-1307, USA. */
#include <stdio.h>
+#include "system.h"
+#ifdef NEED_DECLARATION_CALLOC
+#if defined (__STDC__) || defined (_MSC_VER)
+extern void *calloc ();
+#else
extern char *calloc ();
+#endif
+#endif /* NEED_DECLARATION_CALLOC */
+
+#ifdef NEED_DECLARATION_REALLOC
+#if defined (__STDC__) || defined (_MSC_VER)
+extern void *realloc ();
+#else
extern char *realloc ();
-extern void done ();
+#endif
+#endif /* NEED_DECLARATION_REALLOC */
+
+char *xmalloc PARAMS((register unsigned));
+char *xrealloc PARAMS((register char *, register unsigned));
+
+extern void done PARAMS((int));
extern char *program_name;
char *
-xmalloc (n)
- register unsigned n;
+xmalloc (register unsigned n)
{
register char *block;
@@ -38,7 +56,7 @@ xmalloc (n)
block = calloc (n, 1);
if (block == NULL)
{
- fprintf (stderr, "%s: memory exhausted\n", program_name);
+ fprintf (stderr, _("%s: memory exhausted\n"), program_name);
done (1);
}
@@ -46,9 +64,7 @@ xmalloc (n)
}
char *
-xrealloc (block, n)
- register char *block;
- register unsigned n;
+xrealloc (register char *block, register unsigned n)
{
/* Avoid uncertainty about what an arg of 0 will do. */
if (n == 0)
@@ -56,7 +72,7 @@ xrealloc (block, n)
block = realloc (block, n);
if (block == NULL)
{
- fprintf (stderr, "%s: memory exhausted\n", program_name);
+ fprintf (stderr, _("%s: memory exhausted\n"), program_name);
done (1);
}