Commit 45254bf6 by Kaveh R. Ghazi Committed by Kaveh Ghazi

Makefile.in (jc1, jv-scan): Link with $(SUBDIR_OBSTACK).

        * Makefile.in (jc1, jv-scan): Link with $(SUBDIR_OBSTACK).
        * jv-scan.c: Fix xmalloc prototype.  Provide an xmalloc definition.
        * jvgenmain.c: Remove the xmalloc prototype, we get it from
        libiberty.h.  Provide an xmalloc definition.
        * jvspec.c: Remove the xmalloc prototype.
        * parse-scan.y: Include config.h and system.h.  Don't include
        OS headers or gansidecl.h.  Don't prototype xmalloc/xstrdup.
        Provide an xstrdup definition.

From-SVN: r23934
parent a74d78dd
Fri Nov 27 13:20:51 1998 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* Makefile.in (jc1, jv-scan): Link with $(SUBDIR_OBSTACK).
* jv-scan.c: Fix xmalloc prototype. Provide an xmalloc definition.
* jvgenmain.c: Remove the xmalloc prototype, we get it from
libiberty.h. Provide an xmalloc definition.
* jvspec.c: Remove the xmalloc prototype.
* parse-scan.y: Include config.h and system.h. Don't include
OS headers or gansidecl.h. Don't prototype xmalloc/xstrdup.
Provide an xstrdup definition.
Wed Nov 26 22:03:58 1998 Alexandre Oliva <oliva@dcc.unicamp.br>
* jcf-path.c (add_entry): recognize ".jar" too
......
......@@ -196,11 +196,11 @@ compiler: ../jc1$(exeext) ../jv-scan$(exeext)
../jc1$(exeext): $(P) $(JAVA_OBJS) $(OBJDEPS) $(LIBDEPS)
rm -f ../jc1$(exeext)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
$(JAVA_OBJS) $(OBJS) $(LIBS)
$(JAVA_OBJS) $(OBJS) $(SUBDIR_OBSTACK) $(LIBS)
../jv-scan$(exeext): $(P) $(JAVA_OBJS_LITE) $(OBJDEPS) $(LIBDEPS)
rm -f ../jv-scan$(exeext)
$(CC) $(ALL_CFLAGS) $(LDFLAGS) -o $@ \
$(JAVA_OBJS_LITE) $(LIBS)
$(JAVA_OBJS_LITE) $(SUBDIR_OBSTACK) $(LIBS)
../jcf-dump$(exeext): jcf-dump.o jcf-io.o jcf-depend.o jcf-path.o \
zextract.o
......
......@@ -34,7 +34,7 @@ void fatal VPROTO((char *s, ...));
void warning VPROTO((char *s, ...));
void gcc_obstack_init PROTO ((struct obstack *obstack));
extern void reset_report PROTO ((void));
extern char *xmalloc PROTO((size_t));
extern PTR xmalloc PROTO((size_t));
#define JC1_LITE
#include "parse.h"
......@@ -209,3 +209,14 @@ gcc_obstack_init (obstack)
(void *(*) ()) OBSTACK_CHUNK_ALLOC,
(void (*) ()) OBSTACK_CHUNK_FREE);
}
PTR
xmalloc (size)
size_t size;
{
register PTR val = (PTR) malloc (size);
if (val == 0)
fatal ("virtual memory exhausted");
return val;
}
......@@ -35,8 +35,6 @@ const char class_mangling_prefix[] = "_CL_";
struct obstack name_obstack;
extern char *xmalloc PROTO((size_t));
void
error (const char *str)
{
......@@ -111,3 +109,17 @@ main (int argc, const char **argv)
}
return 0;
}
PTR
xmalloc (size)
size_t size;
{
register PTR val = (PTR) malloc (size);
if (val == 0)
{
fprintf(stderr, "jvgenmain: virtual memory exhausted");
exit(FATAL_EXIT_CODE);
}
return val;
}
......@@ -61,7 +61,6 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */
#define MATH_LIBRARY "-lm"
#endif
extern char *xmalloc PROTO((size_t));
extern int do_spec PROTO((char *));
extern char *input_filename;
extern size_t input_filename_length;
......
......@@ -37,12 +37,9 @@ definitions and other extensions. */
%{
#define JC1_LITE
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "config.h"
#include "system.h"
/* Definitions for PROTO and VPROTO macros */
#include "gansidecl.h"
#include "obstack.h"
extern char *input_filename;
......@@ -91,10 +88,6 @@ struct method_declarator {
static void report_class_declaration PROTO ((char *));
static void report_main_declaration PROTO ((struct method_declarator *));
/* Other extern functions */
char *xmalloc PROTO ((unsigned));
char *xstrdup PROTO ((char *));
#include "lex.h"
#include "parse.h"
%}
......@@ -1160,3 +1153,14 @@ yyerror (msg)
char *msg;
{
}
char *
xstrdup (s)
const char *s;
{
char *ret;
ret = xmalloc (strlen (s) + 1);
strcpy (ret, s);
return ret;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment