From: Kai Koehne Date: Tue, 11 Dec 2012 09:46:56 +0000 (+0100) Subject: Fix compilation with (all versions of) MinGW X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=cf728e60a71629096188f5d680047414dbb4956b;p=profile%2Fivi%2Fqtbase.git Fix compilation with (all versions of) MinGW Commit 320b16110f0f9cef032a64846dc792d40ccd367b changed the arguments of swprintf to be compliant with latest MinGW-w64 headers: The headers now excludes the non-standard swprintf(wchar*t,wchar_t*,...) version for C++11. However, the swprintf(wchar_t*,size_t,wchar_t*,...) version is actually not supported by e.g. stock Mingw-32 from mingw.org. Instead, use _snwprintf(wchar_t*,size_t,wchar_t*,...), which both MSVC, and all MinGW versions should support. Task-number: QTBUG-28520 Change-Id: Icadd11773a25143e46a72c898adfd1c324f9c468 Reviewed-by: Joerg Bornemann --- diff --git a/src/corelib/io/qprocess_win.cpp b/src/corelib/io/qprocess_win.cpp index 780efda..bd2ca4c 100644 --- a/src/corelib/io/qprocess_win.cpp +++ b/src/corelib/io/qprocess_win.cpp @@ -82,7 +82,7 @@ static void qt_create_pipe(Q_PIPE *pipe, bool isInputPipe) forever { // ### The user must make sure to call qsrand() to make the pipe names less predictable. // ### Replace the call to qrand() with a secure version, once we have it in Qt. - swprintf(pipeName, sizeof(pipeName) / sizeof(pipeName[0]), + _snwprintf(pipeName, sizeof(pipeName) / sizeof(pipeName[0]), L"\\\\.\\pipe\\qt-%X", qrand()); DWORD dwPipeFlags = PIPE_TYPE_BYTE | PIPE_WAIT;