diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 8c90fab424..60d9067669 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -1169,6 +1169,7 @@ set (PCH_SOURCES events.cpp GuillotineBinPack.cpp SkylineBinPack.cpp + tmpfileplus.cpp ) enable_precompiled_headers( g_pch.h PCH_SOURCES ) @@ -1183,7 +1184,6 @@ add_executable( zdoom WIN32 MACOSX_BUNDLE ${PCH_SOURCES} x86.cpp strnatcmp.c - tmpfileplus.c zstring.cpp math/asin.c math/atan.c diff --git a/src/tmpfileplus.c b/src/tmpfileplus.cpp similarity index 99% rename from src/tmpfileplus.c rename to src/tmpfileplus.cpp index ddb71de092..5475d8f8fd 100644 --- a/src/tmpfileplus.c +++ b/src/tmpfileplus.cpp @@ -217,7 +217,7 @@ static FILE *mktempfile_internal(const char *tmpdir, const char *pfx, char **tmp lentempname = strlen(tmpdir) + strlen(FILE_SEPARATOR) + strlen(pfx) + strlen(randpart); DPRINTF1("lentempname=%d\n", lentempname); - tmpname = malloc(lentempname + 1); + tmpname = (char*)malloc(lentempname + 1); if (!tmpname) { errno = ENOMEM;