#include "mkdeps.h"
#include "splay-tree.h"
#ifdef ENABLE_VALGRIND_CHECKING
-#include <valgrind.h>
+# ifdef HAVE_MEMCHECK_H
+# include <memcheck.h>
+# else
+# include <valgrind.h>
+# endif
#else
/* Avoid #ifdef:s when we can help it. */
#define VALGRIND_DISCARD(x)
SOURCE_LINE (pfile->map, pfile->line), flags);
}
+/* Allow the client to change the current file. Used by the front end
+ to achieve pseudo-file names like <built-in>.
+ If REASON is LC_LEAVE, then NEW_NAME must be NULL. */
+void
+cpp_change_file (pfile, reason, new_name)
+ cpp_reader *pfile;
+ enum lc_reason reason;
+ const char *new_name;
+{
+ _cpp_do_file_change (pfile, reason, new_name, 1, 0);
+}
+
/* Report on all files that might benefit from a multiple include guard.
Triggered by -H. */
void
return stack_include_file (pfile, f);
}
+/* Pushes the given file onto the buffer stack. Returns nonzero if
+ successful. */
+bool
+cpp_push_include (pfile, filename)
+ cpp_reader *pfile;
+ const char *filename;
+{
+ cpp_token header;
+
+ header.type = CPP_STRING;
+ header.val.str.text = (const unsigned char *) filename;
+ header.val.str.len = strlen (filename);
+ /* Make the command line directive take up a line. */
+ pfile->line++;
+
+ return _cpp_execute_include (pfile, &header, IT_CMDLINE);
+}
+
/* Do appropriate cleanup when a file INC's buffer is popped off the
input stack. */
void