[qfcc] Report errors accessing source files

This got lost in the switch to internal preprocessing as cpp used to do
the job for us.
This commit is contained in:
Bill Currie 2024-08-21 16:12:52 +09:00
parent 6a70ecda9d
commit 3abf69cb36

View file

@ -671,7 +671,13 @@ preprocess_file (const char *filename, const char *ext)
return run_cpp (filename, ext); return run_cpp (filename, ext);
} else { } else {
set_line_file (1, filename, 0); set_line_file (1, filename, 0);
return fopen (filename, "rb"); FILE *file = fopen (filename, "rb");
if (!file) {
fprintf (stderr, "%s: error: %s: %s\n", this_program, filename,
strerror (errno));
pr.error_count++;
}
return file;
} }
} }