Skip to content

Commit dc636fb

Browse files
Jinjin.Hesbaluja
authored andcommitted
fix tmpnam_s call error while using MinGW
1 parent 3d6e7ab commit dc636fb

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/aws-cpp-sdk-core/source/platform/windows/FileSystem.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,11 @@ Aws::String CreateTempFilePath()
317317
// Definition from the MSVC stdio.h
318318
#define L_tmpnam_s (sizeof("\\") + 16)
319319
#endif
320+
321+
#ifdef __MINGW64_VERSION_MAJOR < 12
322+
#undef L_tmpnam_s
323+
#define L_tmpnam_s 260
324+
#endif
320325
char s_tempName[L_tmpnam_s+1];
321326

322327
/*
@@ -328,7 +333,7 @@ Aws::String CreateTempFilePath()
328333
for more details.
329334
*/
330335

331-
#if _MSC_VER >= 1900
336+
#if _MSC_VER >= 1900 || defined(_UCRT)
332337
tmpnam_s(s_tempName, L_tmpnam_s);
333338
#else
334339
s_tempName[0] = '.';

0 commit comments

Comments
 (0)