From 1e8b9746d3bbc54b8ba4a0d02f049d169163a851 Mon Sep 17 00:00:00 2001 From: zack Date: Wed, 8 Mar 2000 23:35:19 +0000 Subject: * Makefile.in (LIBCPP_DEPS): New macro. (cpplib.o, cpphash.o, cpperror.o, cppexp.o, cppfiles.o): Use it to declare deps. * cpperror.c: Include cpphash.h. * cppexp.c: Include cpphash.h. Remove MULTIBYTE_CHARS dingleberry. (lex): Don't use CPP_WARN_UNDEF. (_cpp_parse_expr): Return an int, the truth value. * cppfiles.c: Include cpphash.h. (_cpp_merge_include_chains): Move to cppinit.c and make static. * cppinit.c (include_defaults_array): Disentangle. (cpp_cleanup): Don't free the if stack here. (cpp_finish): Pop off all buffers, not just one. * cpplib.c (eval_if_expr): Return int. (do_xifdef): Rename do_ifdef. (handle_directive): Don't use CPP_PREPROCESSED. (cpp_get_token): Don't use CPP_C89. * fix-header.c: Don't use CPP_OPTIONS. * cpplib.h: Move U_CHAR, enum node_type, struct file_name_list, struct ihash, is_idchar, is_idstart, is_numchar, is_numstart, is_hspace, is_space, CPP_BUF_PEEK, CPP_BUF_GET, CPP_FORWARD, CPP_PUTS, CPP_PUTS_Q, CPP_PUTC, CPP_PUTC_Q, CPP_NUL_TERMINATE, CPP_NUL_TERMINATE_Q, CPP_BUMP_BUFFER_LINE, CPP_BUMP_LINE, CPP_PREV_BUFFER, CPP_PRINT_DEPS, CPP_TRADITIONAL, CPP_PEDANTIC, and prototypes of _cpp_simplify_pathname, _cpp_find_include_file, _cpp_read_include_file, and _cpp_parse_expr to cpphash.h. Move struct if_stack to cpplib.c. Move struct cpp_pending to cppinit.c. Change all uses of U_CHAR to be unsigned char instead. Delete CPP_WARN_UNDEF, CPP_C89, and CPP_PREPROCESSED. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@32435 138bc75d-0d04-0410-961f-82ee72b054a4 --- gcc/cppexp.c | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'gcc/cppexp.c') diff --git a/gcc/cppexp.c b/gcc/cppexp.c index 3ed818c188a..bb2ae7a3ad8 100644 --- a/gcc/cppexp.c +++ b/gcc/cppexp.c @@ -27,10 +27,7 @@ Written by Per Bothner 1994. */ #include "config.h" #include "system.h" #include "cpplib.h" - -#ifdef MULTIBYTE_CHARS -#include -#endif +#include "cpphash.h" #ifndef CHAR_TYPE_SIZE #define CHAR_TYPE_SIZE BITS_PER_UNIT @@ -453,7 +450,7 @@ lex (pfile, skip_evaluation) op.unsignedp = 0; op.value = 0; - if (CPP_WARN_UNDEF (pfile) && !skip_evaluation) + if (CPP_OPTIONS (pfile)->warn_undef && !skip_evaluation) cpp_warning (pfile, "`%.*s' is not defined", (int) (tok_end - tok_start), tok_start); return op; @@ -669,9 +666,9 @@ right_shift (pfile, a, unsignedp, b) ? (unsigned HOST_WIDEST_INT) v1 OP (unsigned HOST_WIDEST_INT) v2 : (v1 OP v2) /* Parse and evaluate a C expression, reading from PFILE. - Returns the value of the expression. */ + Returns the truth value of the expression. */ -HOST_WIDEST_INT +int _cpp_parse_expr (pfile) cpp_reader *pfile; { @@ -1004,7 +1001,7 @@ _cpp_parse_expr (pfile) cpp_ice (pfile, "unbalanced stack in #if expression"); if (stack != init_stack) free (stack); - return top->value; + return (top->value != 0); } top++; -- cgit v1.2.3