Skip to content

Commit

Permalink
disable stdio locking for Win32, dmake is single threaded
Browse files Browse the repository at this point in the history
In MS and Mingw's headers, there is no define from fputc to _fputc_nolock.
This has to be done manually.

mingw 4.6.3 has _fputc_nolock in its headers so use it.
  • Loading branch information
bulk88 committed Mar 10, 2015
1 parent aac838b commit 7bafaff
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 0 deletions.
4 changes: 4 additions & 0 deletions extern.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@ sysintf.c(1132) : warning C4996: 'unlink' was declared deprecated
Message: 'The POSIX name for this item is deprecated. Instead, use the I
SO C++ conformant name: _unlink. See online help for details.' */
#define _CRT_NONSTDC_NO_DEPRECATE
/* get back some of the perf loss caused by >= VC 2005 dropping single threaded
static link CRT, this macro disables multithreading locks on some stdio
functions */
#define _CRT_DISABLE_PERFCRIT_LOCKS
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#endif
Expand Down
4 changes: 4 additions & 0 deletions win95/microsft/sysintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,3 +61,7 @@ extern char * getcwd();
#undef _POSIX_PATH_MAX
#endif
#define _POSIX_PATH_MAX _MAX_PATH

#if _MSC_VER >= 1400
# define fputc(_c,_stream) _fputc_nolock(_c,_stream)
#endif
4 changes: 4 additions & 0 deletions winnt/microsft/sysintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,3 +47,7 @@ extern char * getcwd();
#undef _POSIX_PATH_MAX
#endif
#define _POSIX_PATH_MAX _MAX_PATH

#if _MSC_VER >= 1400
# define fputc(_c,_stream) _fputc_nolock(_c,_stream)
#endif
2 changes: 2 additions & 0 deletions winnt/mingw/sysintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,5 @@ extern char * getcwd();
#undef _POSIX_PATH_MAX
#endif
#define _POSIX_PATH_MAX _MAX_PATH

#define fputc(_c,_stream) _fputc_nolock(_c,_stream)
4 changes: 4 additions & 0 deletions winnt/msvc6/sysintf.h
Original file line number Diff line number Diff line change
Expand Up @@ -52,3 +52,7 @@ extern char * getcwd();
#undef _POSIX_PATH_MAX
#endif
#define _POSIX_PATH_MAX _MAX_PATH

#if _MSC_VER >= 1400
# define fputc(_c,_stream) _fputc_nolock(_c,_stream)
#endif

0 comments on commit 7bafaff

Please sign in to comment.