Written by Per Bothner <bothner@cygnus.com>, July 1993. */
-#include "hconfig.h"
+#include "bconfig.h"
#include "system.h"
+#include "coretypes.h"
+#include "tm.h"
#include "obstack.h"
#include "scan.h"
#include "cpplib.h"
/* The following are only used when handling stdlib.h */
int seen_EXIT_FAILURE = 0, seen_EXIT_SUCCESS = 0;
\f
-#define obstack_chunk_alloc xmalloc
-#define obstack_chunk_free free
struct obstack scan_file_obstack;
/* NOTE: If you edit this, also edit gen-protos.c !! */
int required_unseen_count = 0;
int required_other = 0;
-static void
+static void
write_lbrac ()
{
-
+
#if ADD_MISSING_EXTERN_C
if (missing_extern_C_count + required_unseen_count > 0)
fprintf (outf, "#ifdef __cplusplus\nextern \"C\" {\n#endif\n");
/* If we have a full prototype, we're done. */
if (have_arg_list)
return;
-
+
if (kind == 'I') /* don't edit inline function */
return;
int i;
struct symbol_list *cur_symbols;
- obstack_init (&scan_file_obstack);
+ obstack_init (&scan_file_obstack);
scan_in = cpp_create_reader (CLK_GNUC89);
cb = cpp_get_callbacks (scan_in);
options->inhibit_errors = 1;
i = cpp_handle_options (scan_in, argc, argv);
- if (i < argc && ! CPP_FATAL_ERRORS (scan_in))
- cpp_fatal (scan_in, "Invalid option `%s'", argv[i]);
- cpp_post_options (scan_in);
- if (CPP_FATAL_ERRORS (scan_in))
+ if (i < argc)
+ cpp_error (scan_in, DL_ERROR, "invalid option `%s'", argv[i]);
+ if (cpp_errors (scan_in))
exit (FATAL_EXIT_CODE);
if (! cpp_read_main_file (scan_in, in_fname, NULL))
if (required_unseen_count + partial_count + required_other
#if ADD_MISSING_EXTERN_C
+ missing_extern_C_count
-#endif
+#endif
== 0)
{
if (verbose)
progname = 0;
for (p = argv[0]; *p; p++)
- if (*p == '/')
- progname = p;
+ if (*p == '/')
+ progname = p;
progname = progname ? progname+1 : argv[0];
}
exit (SUCCESS_EXIT_CODE);
}
}
-
+
}
#endif
else
symbol_table[0].names = NULL;
- /* Count and mark the prototypes required for this include file. */
+ /* Count and mark the prototypes required for this include file. */
for (cur_symbols = &symbol_table[0]; cur_symbols->names; cur_symbols++)
{
int name_len;
fprintf (stderr, "%s: %s: ", progname, inc_filename);
vfprintf (stderr, str, ap);
fprintf (stderr, "\n");
-
+
exit (FATAL_EXIT_CODE);
}