cmGccDepfileLexerHelper: Use fopen from SystemTools

Delegate to SystemTools for portability and consistency with the rest
of the code base.
This commit is contained in:
Tyler Yankee
2026-07-22 09:30:00 -04:00
parent 0f5dcc887a
commit 8b653cd50c

View File

@@ -8,23 +8,17 @@
#include <vector>
#include "cmGccDepfileReaderTypes.h"
#include "cmSystemTools.h"
#include "LexerParser/cmGccDepfileLexer.h"
#ifdef _WIN32
# include "cmsys/Encoding.h"
# include "cmsys/String.h"
#endif
bool cmGccDepfileLexerHelper::readFile(char const* filePath)
{
#ifdef _WIN32
wchar_t* wpath = cmsysEncoding_DupToWide(filePath);
FILE* file = _wfopen(wpath, L"rb");
free(wpath);
#else
FILE* file = fopen(filePath, "r");
#endif
FILE* file = cmsys::SystemTools::Fopen(filePath, "rb");
if (!file) {
return false;
}