Codechange: Store info about the dedicated server log file in globals with automatic destruction to simplify control flow in openttd_main.

This commit is contained in:
Michael Lutz
2020-05-17 23:32:10 +02:00
parent 37bc2f8064
commit c972a63c8c
4 changed files with 26 additions and 30 deletions

View File

@@ -159,4 +159,12 @@ public:
}
};
/** Helper to manage a FILE with a \c std::unique_ptr. */
struct FileDeleter {
void operator()(FILE *f)
{
if (f) fclose(f);
}
};
#endif /* FILEIO_FUNC_H */