// Files included by the preprocessor and their hashes.
// Key: file path. Value: struct digest.
std::unordered_map<std::string, digest> included_files;
+
+ // Uses absolute path for some include files.
+ bool has_absolute_include_headers = false;
};
}
// p and q span the include file path.
char* inc_path = x_strndup(p, q - p);
- if (!has_absolute_include_headers) {
- has_absolute_include_headers = is_absolute_path(inc_path);
+ if (!ctx.has_absolute_include_headers) {
+ ctx.has_absolute_include_headers = is_absolute_path(inc_path);
}
char* saved_inc_path = inc_path;
inc_path = x_strdup(make_relative_path(ctx, inc_path).c_str());
cc_log("Base dir not set, skip using relative paths");
return; // nothing to do
}
- if (!has_absolute_include_headers) {
+ if (!ctx.has_absolute_include_headers) {
cc_log(
"No absolute path for included files found, skip using relative"
" paths");
if (str_endswith(token, ":") || str_eq(token, "\\")) {
continue;
}
- if (!has_absolute_include_headers) {
- has_absolute_include_headers = is_absolute_path(token);
+ if (!ctx.has_absolute_include_headers) {
+ ctx.has_absolute_include_headers = is_absolute_path(token);
}
std::string path = make_relative_path(ctx, token);
remember_include_file(ctx, path, hash, false, hash);
}
free_and_nullify(ignore_headers);
ignore_headers_len = 0;
- has_absolute_include_headers = false;
i_tmpfile = NULL;
free_and_nullify(cpp_stderr);
}