Update UnitTestFileGenerator.h

kimkulling/add_windows_clang_issue-5519
Kim Kulling 2024-04-09 21:00:07 +02:00 committed by GitHub
parent c740977594
commit 0142bc35f7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 6 additions and 6 deletions

View File

@ -54,15 +54,15 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <io.h>
inline FILE* MakeTmpFile(char* tmplate)
{
auto err = _mktemp_s(tmplate, std::strlen(tmplate));
EXPECT_NE(tmplate, nullptr);
if(tmplate == nullptr)
auto pathtemplate = _mktemp(tmplate);
EXPECT_NE(pathtemplate, nullptr);
if(pathtemplate == nullptr)
{
return nullptr;
}
FILE *fs = nullptr;
err = fopen_s(&fs, tmplate, "w+");
EXPECT_EQ(err, 0);
auto* fs = std::fopen(pathtemplate, "w+");
EXPECT_NE(fs, nullptr); return fs;
return fs;
}
#elif defined(__GNUC__) || defined(__clang__)