/* Part of CPP library. (Precompiled header reading/writing.)
- Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
+ Copyright (C) 2000, 2001, 2002, 2003, 2004 Free Software Foundation, Inc.
This program is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
if (fwrite (&s, sizeof (s), 1, f) != 1
|| fwrite (defn, 1, s.definition_length, f) != s.definition_length)
{
- cpp_errno (pfile, DL_ERROR, "while writing precompiled header");
+ cpp_errno (pfile, CPP_DL_ERROR,
+ "while writing precompiled header");
return 0;
}
}
if (fwrite (&z, sizeof (z), 1, f) != 1
|| fwrite (ss->definedstrs, ss->hashsize, 1, f) != 1)
{
- cpp_errno (r, DL_ERROR, "while writing precompiled header");
+ cpp_errno (r, CPP_DL_ERROR, "while writing precompiled header");
return -1;
}
free (ss->definedstrs);
memset (&z, 0, sizeof (z));
if (fwrite (&z, sizeof (z), 1, f) != 1)
{
- cpp_errno (r, DL_ERROR, "while writing precompiled header");
+ cpp_errno (r, CPP_DL_ERROR, "while writing precompiled header");
return -1;
}
if (deps_save (r->deps, f) != 0)
{
- cpp_errno (r, DL_ERROR, "while writing precompiled header");
+ cpp_errno (r, CPP_DL_ERROR, "while writing precompiled header");
+ return -1;
+ }
+
+ if (! _cpp_save_file_entries (r, f))
+ {
+ cpp_errno (r, CPP_DL_ERROR, "while writing precompiled header");
return -1;
}
|| h->flags & NODE_POISONED)
{
if (CPP_OPTION (r, warn_invalid_pch))
- cpp_error (r, DL_WARNING_SYSHDR,
+ cpp_error (r, CPP_DL_WARNING_SYSHDR,
"%s: not used because `%.*s' not defined",
name, m.name_length, namebuf);
goto fail;
|| memcmp (namebuf, newdefn, m.definition_length) != 0)
{
if (CPP_OPTION (r, warn_invalid_pch))
- cpp_error (r, DL_WARNING_SYSHDR,
+ cpp_error (r, CPP_DL_WARNING_SYSHDR,
"%s: not used because `%.*s' defined as `%s' not `%.*s'",
name, m.name_length, namebuf, newdefn + m.name_length,
m.definition_length - m.name_length,
else
{
if (CPP_OPTION (r, warn_invalid_pch))
- cpp_error (r, DL_WARNING_SYSHDR,
+ cpp_error (r, CPP_DL_WARNING_SYSHDR,
"%s: not used because `%s' is defined",
name, first);
goto fail;
return 0;
error:
- cpp_errno (r, DL_ERROR, "while reading precompiled header");
+ cpp_errno (r, CPP_DL_ERROR, "while reading precompiled header");
return -1;
fail:
else if (m.name_length != m.definition_length)
{
if (cpp_push_buffer (r, defn + m.name_length,
- m.definition_length - m.name_length,
- true, 1) != NULL)
+ m.definition_length - m.name_length, true)
+ != NULL)
{
_cpp_clean_line (r);
if (!_cpp_create_definition (r, h))
!= 0)
goto error;
+ if (! _cpp_read_file_entries (r, f))
+ goto error;
+
return 0;
error:
- cpp_errno (r, DL_ERROR, "while reading precompiled header");
+ cpp_errno (r, CPP_DL_ERROR, "while reading precompiled header");
return -1;
}