+Thu May 21 11:54:44 1998 Dave Brolley <brolley@cygnus.com>
+
+ * lex.c: (handle_sysv_pragma): FILE* parameter not used.
+ (cpp_reader,parse_in): Add for cpplib.
+ (check_newline): Call handle_sysv_pragma with new interface.
+ (check_newline): Call GET_DIRECTIVE_LINE, not get_directive_line.
+
+ * input.c: (yy_cur,yy_lim,yy_get_token,GETC): Add for cpplib.
+ (sub_getch): Call GETC for cpplib.
+
+ * cp-tree.h: (get_directive_line): Different prototype for cpplib.
+ (GET_DIRECTIVE_LINE): Macro wrapper for get_directive_line.
+
+ * Makefile.in (CXX_OBJS): add @extra_cxx_objs@ for cpplib.
+
1998-05-21 Jason Merrill <jason@yorick.cygnus.com>
* decl2.c (maybe_make_one_only): New fn.
CXX_OBJS = call.o decl.o errfn.o expr.o pt.o sig.o typeck2.o \
class.o decl2.o error.o lex.o parse.o ptree.o rtti.o spew.o typeck.o cvt.o \
- except.o friend.o init.o method.o search.o semantics.o tree.o xref.o repo.o
+ except.o friend.o init.o method.o search.o semantics.o tree.o xref.o repo.o \
+ @extra_cxx_objs@
# Language-independent object files.
OBJS = `cat ../stamp-objlist` ../c-common.o ../c-pragma.o
extern void overflow_warning PROTO((tree));
extern void unsigned_conversion_warning PROTO((tree, tree));
/* Read the rest of the current #-directive line. */
+#if USE_CPPLIB
+extern char *get_directive_line PROTO((void));
+#define GET_DIRECTIVE_LINE() get_directive_line ()
+#else
extern char *get_directive_line PROTO((FILE *));
+#define GET_DIRECTIVE_LINE() get_directive_line (finput)
+#endif
/* Subroutine of build_binary_op, used for comparison operations.
See if the operands have both been converted from subword integer types
and, if so, perhaps change them both back to their original type. */
#define inline
#endif
+#if USE_CPPLIB
+extern unsigned char *yy_cur, *yy_lim;
+extern int yy_get_token ();
+#define GETC() (yy_cur < yy_lim ? *yy_cur++ : yy_get_token ())
+#else
+#define GETC() getc (finput)
+#endif
+
extern void feed_input PROTO((char *, int));
extern void put_input PROTO((int));
extern void put_back PROTO((int));
}
return (unsigned char)input->str[input->offset++];
}
- return getc (finput);
+ return GETC ();
}
inline
static int *init_cpp_parse PROTO((void));
static int handle_cp_pragma PROTO((char *));
#ifdef HANDLE_SYSV_PRAGMA
-static int handle_sysv_pragma PROTO((FILE *, int));
+static int handle_sysv_pragma PROTO((int));
#endif
#ifdef GATHER_STATISTICS
#ifdef REDUCE_LENGTH
struct obstack inline_text_obstack;
char *inline_text_firstobj;
-#if !USE_CPPLIB
+#if USE_CPPLIB
+#include "cpplib.h"
+extern cpp_reader parse_in;
+#else
FILE *finput;
#endif
int end_of_file;
int linemode;
-#ifdef HANDLE_SYSV_PRAGMA
-static int handle_sysv_pragma PROTO((FILE *, int));
-#endif
static int handle_cp_pragma PROTO((char *));
static int
goto skipline;
#ifdef HANDLE_SYSV_PRAGMA
- if (handle_sysv_pragma (finput, token))
+ if (handle_sysv_pragma (token))
goto skipline;
#else
#ifdef HANDLE_PRAGMA
- if (HANDLE_PRAGMA (finput, yylval.ttype))
- goto skipline;
+#if USE_CPPLIB
+ /* TODO: ??? */
+ goto skipline;
+#else
+ if (HANDLE_PRAGMA (finput, yylval.ttype))
+ goto skipline;
+#endif /* !USE_CPPLIB */
#endif
#endif
}
&& getch () == 'e'
&& ((c = getch ()) == ' ' || c == '\t'))
{
- debug_define (lineno, get_directive_line (finput));
+ debug_define (lineno, GET_DIRECTIVE_LINE ());
goto skipline;
}
}
&& getch () == 'f'
&& ((c = getch ()) == ' ' || c == '\t'))
{
- debug_undef (lineno, get_directive_line (finput));
+ debug_undef (lineno, GET_DIRECTIVE_LINE ());
goto skipline;
}
}
the token types. */
static int
-handle_sysv_pragma (finput, token)
- FILE *finput;
+handle_sysv_pragma (token)
register int token;
{
for (;;)