X-Git-Url: https://git.saurik.com/bison.git/blobdiff_plain/40675e7cc90b44d3c82c424946ea55083eb78121..86b7964abb89245df897696bcf7321090837cb0e:/src/allocate.c diff --git a/src/allocate.c b/src/allocate.c index a74dc182..fdc83856 100644 --- a/src/allocate.c +++ b/src/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 +#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); }