On 8/2/2015 06:27, Mateusz wrote: > We have 4 functions from printf family that output to FILE stream: > printf, vprintf, fprintf, vfprintf > > We have also puts/fputs functions that output to FILE stream and are > always directly from msvcrt.dll. > > puts/fputs functions are atomic with Microsoft lock. If we want > mingw-w64 printf functions (__USE_MINGW_ANSI_STDIO) to be atomic against > puts/fputs functions, we must copy lock from Microsoft sources. > > Microsoft use _lock_file/_unlock_file lock to stdio functions, so patch > for mingw-w64 > printf, vprintf, fprintf, vfprintf > functions are obvious -- _lock_file -> __pformat -> _unlock_file > > There is one problem: _lock_file/_unlock_file are exported from > msvcr*.dll starting from version msvcr90.dll. There are no such > functions in msvcrt.dll & msvcr80.dll. > > My proposition: we can add obvious patch to mingw-w64 printf functions > family and copy _lock_file/_unlock_file from MS sources and add only to > libmsvcrt.a & libmsvcr80.a. > > I attached diff file that is not complete -- there is to do add > mingw_lock.c source to libmsvcrt.a & libmsvcr80.a. >
Please resend patch in unified diff form. I spoke with Kai earlier, he wants __pformat behavior unchanged for performance reasons, preferring programs to handle their own locking, you may be able to convince him otherwise.
0xD4EBC740.asc
Description: application/pgp-keys
signature.asc
Description: OpenPGP digital signature
------------------------------------------------------------------------------
_______________________________________________ Mingw-w64-public mailing list Mingw-w64-public@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/mingw-w64-public