diff options
author | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-09-13 03:57:40 +0000 |
---|---|---|
committer | ghazi <ghazi@138bc75d-0d04-0410-961f-82ee72b054a4> | 1999-09-13 03:57:40 +0000 |
commit | 7f0b0c275fbaeae21c3257af05ed98fe64837330 (patch) | |
tree | 6e552cd6afac414afba22bf962c7bef94bf8e7f5 /gcc/java/jvspec.c | |
parent | 5b592939d9252a01123b7d7e35501317468fa089 (diff) | |
download | gcc-7f0b0c275fbaeae21c3257af05ed98fe64837330.tar.gz |
* Makefile.in (gcc.o, gccspec.o, cppspec.o): Depend on gcc.h.
* gcc.h: New file.
(lang_specific_driver): Don't take a function pointer parameter.
All callers changed.
* gcc.c: Include gcc.h.
(do_spec, fancy_abort,lang_specific_driver,lang_specific_pre_link,
lang_specific_extra_outfiles, fatal): Don't declare.
(multilib_defaults_raw): Constify.
(read_specs): Call memset, rather than bzero.
(main): Call return, not exit.
(lookup_compiler): Call memcpy, not bcopy.
(fatal): Make extern.
* cppspec.c: Include gcc.h.
(lang_specific_driver): Initialize variable `quote'. Constify a
char*. All calls to the function pointer parameter now
explicitly call `fatal'.
* gccspec.c (lang_specific_driver): Include gcc.h.
cp:
* Make-lang.in (g++spec.o): Depend on system.h and gcc.h.
* g++spec.c: Include gcc.h.
(lang_specific_driver): Constify a char*. Call xcalloc, not
xmalloc/bzero. All calls to the function pointer parameter now
explicitly call `fatal'.
f:
* Make-lang.in (g77spec.o): Depend on system.h and gcc.h.
* g77spec.c: Include gcc.h.
(g77_xargv): Constify.
(g77_fn): Add parameter prototypes.
(lookup_option, append_arg): Add static prototypes.
(g77_newargv): Constify.
(lookup_option, append_arg, lang_specific_driver): Constify a char*.
(lang_specific_driver): All calls to the function pointer
parameter now explicitly call `fatal'.
java:
* Make-lang.in (jvspec.o): Depend on system.h and gcc.h.
* jvspec.c: Include gcc.h. Don't include gansidecl.h.
(do_spec, lang_specific_pre_link, lang_specific_driver,
input_filename, input_filename_length): Don't declare.
(main_class_name, jvgenmain_spec, lang_specific_driver):
Constify a char*.
(lang_specific_driver): All calls to the function pointer
parameter now explicitly call `fatal'.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@29367 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/java/jvspec.c')
-rw-r--r-- | gcc/java/jvspec.c | 43 |
1 files changed, 18 insertions, 25 deletions
diff --git a/gcc/java/jvspec.c b/gcc/java/jvspec.c index 81b2b5284d9..e3b3a23a5e6 100644 --- a/gcc/java/jvspec.c +++ b/gcc/java/jvspec.c @@ -24,10 +24,8 @@ of Sun Microsystems, Inc. in the United States and other countries. The Free Software Foundation is independent of Sun Microsystems, Inc. */ #include "config.h" - #include "system.h" - -#include "gansidecl.h" +#include "gcc.h" /* Name of spec file. */ #define SPEC_FILE "libgcj.spec" @@ -42,14 +40,8 @@ The Free Software Foundation is independent of Sun Microsystems, Inc. */ #define CLASS_FILE_ARG (1<<4) static char *find_spec_file PROTO ((const char *)); -extern int do_spec PROTO((char *)); -extern int lang_specific_pre_link PROTO((void)); -extern void lang_specific_driver PROTO ((void (*) (const char *, ...), - int *, char ***, int *)); -extern char *input_filename; -extern size_t input_filename_length; - -char *main_class_name = NULL; + +static const char *main_class_name = NULL; int lang_specific_extra_outfiles = 0; /* Once we have the proper support in jc1 (and gcc.c) working, @@ -57,7 +49,7 @@ int lang_specific_extra_outfiles = 0; and *.class input files to be passed to a single jc1 invocation. */ #define COMBINE_INPUTS 0 -char jvgenmain_spec[] = +const char jvgenmain_spec[] = "jvgenmain %i %{!pipe:%u.i} |\n\ cc1 %{!pipe:%U.i} %1 \ %{!Q:-quiet} -dumpbase %b.c %{d*} %{m*} %{a*}\ @@ -92,8 +84,7 @@ find_spec_file (dir) } void -lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) - void (*fn) PROTO ((const char *, ...)); +lang_specific_driver (in_argc, in_argv, in_added_libraries) int *in_argc; char ***in_argv; int *in_added_libraries; @@ -138,10 +129,11 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) /* Used to track options that take arguments, so we don't go wrapping those with -xc++/-xnone. */ - char *quote = NULL; + const char *quote = NULL; /* The new argument list will be contained in this. */ - char **arglist; + char **real_arglist; + const char **arglist; /* Non-zero if we saw a `-xfoo' language specification on the command line. Used to avoid adding our own -xc++ if the user @@ -149,16 +141,16 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) int saw_speclang = 0; /* "-lm" or "-lmath" if it appears on the command line. */ - char *saw_math ATTRIBUTE_UNUSED = 0; + const char *saw_math ATTRIBUTE_UNUSED = 0; /* "-lc" if it appears on the command line. */ - char *saw_libc ATTRIBUTE_UNUSED = 0; + const char *saw_libc ATTRIBUTE_UNUSED = 0; /* "-lgcjgc" if it appears on the command line. */ - char *saw_gc ATTRIBUTE_UNUSED = 0; + const char *saw_gc ATTRIBUTE_UNUSED = 0; /* Saw `-l' option for the thread library. */ - char *saw_threadlib ATTRIBUTE_UNUSED = 0; + const char *saw_threadlib ATTRIBUTE_UNUSED = 0; /* Saw `-lgcj' on command line. */ int saw_libgcj ATTRIBUTE_UNUSED = 0; @@ -337,7 +329,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) } if (quote) - (*fn) ("argument to `%s' missing\n", quote); + fatal ("argument to `%s' missing\n", quote); num_args = argc + added; if (saw_C) @@ -349,7 +341,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) num_args += 2; /* For -o NONE. */ #endif if (saw_o) - (*fn) ("cannot specify both -C and -o"); + fatal ("cannot specify both -C and -o"); } #if COMBINE_INPUTS if (saw_o && java_files_count + (saw_C ? 0 : class_files_count) > 1) @@ -385,7 +377,8 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) if (saw_g + saw_O == 0) num_args++; num_args++; - arglist = (char **) xmalloc ((num_args + 1) * sizeof (char *)); + arglist = (const char **) + (real_arglist = (char **) xmalloc ((num_args + 1) * sizeof (char *))); for (i = 0, j = 0; i < argc; i++, j++) { @@ -421,7 +414,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) if (strncmp (argv[i], "-fmain=", 7) == 0) { if (! will_link) - (*fn) ("cannot specify `main' class when not linking"); + fatal ("cannot specify `main' class when not linking"); --j; continue; } @@ -480,7 +473,7 @@ lang_specific_driver (fn, in_argc, in_argv, in_added_libraries) arglist[j] = NULL; *in_argc = j; - *in_argv = arglist; + *in_argv = real_arglist; *in_added_libraries = added_libraries; } |