forked from mirror/OpenTTD
Change: [Win32] Parse and load DLS files for the DirectMusic driver without relying on high-level functions.
This commit is contained in:
@@ -149,4 +149,17 @@ static inline DIR *ttd_opendir(const char *path)
|
||||
return opendir(OTTD2FS(path));
|
||||
}
|
||||
|
||||
|
||||
/** Auto-close a file upon scope exit. */
|
||||
class FileCloser {
|
||||
FILE *f;
|
||||
|
||||
public:
|
||||
FileCloser(FILE *_f) : f(_f) {}
|
||||
~FileCloser()
|
||||
{
|
||||
fclose(f);
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* FILEIO_FUNC_H */
|
||||
|
Reference in New Issue
Block a user