Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Pops a single buffer, with a file change call-back if appropriate.
- Then pushes the next -include file, if any remain. */
- void
- _cpp_pop_buffer (cpp_reader *pfile)
- {
- cpp_buffer *buffer = pfile->buffer;
- struct _cpp_file *inc = buffer->file;
- struct if_stack *ifs;
- const unsigned char *to_free;
- enum include_type inc_type;
- /* Walk back up the conditional stack till we reach its level at
- entry to this file, issuing error messages. */
- for (ifs = buffer->if_stack; ifs; ifs = ifs->next)
- cpp_error_with_line (pfile, CPP_DL_ERROR, ifs->line, 0,
- "unterminated #%s", dtable[ifs->type].name);
- if (inc)
- {
- inc_type = buffer->inc_type;
- if (CPP_WHEADER_GUARD (pfile) && pfile->mi_valid)
- warn_header_guard (pfile);
- }
- /* In case of a missing #endif. */
- pfile->state.skipping = 0;
- /* _cpp_do_file_change expects pfile->buffer to be the new one. */
- pfile->buffer = buffer->prev;
- to_free = buffer->to_free;
- free (buffer->notes);
- /* Free the buffer object now; we may want to push a new buffer
- in _cpp_push_next_include_file. */
- obstack_free (&pfile->buffer_ob, buffer);
- if (inc)
- {
- _cpp_pop_file_buffer (pfile, inc, to_free, inc_type);
- _cpp_do_file_change (pfile, LC_LEAVE, 0, 0, 0);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement