Skip to content

Commit

Permalink
dont disable stdout buffering, if setvbuf not available
Browse files Browse the repository at this point in the history
All MS CRTs, MSVCRT10.DLL and up, export setvbuf. Previously, 1 kernel
write to the console handle, with 1 byte per write, was being done by MS
CRT printf() on a VC build. On other OSes, stdout is usually line buffered
so make the setvbuf in dmake.c's main() a noop if setvbuf isn't available.
  • Loading branch information
bulk88 authored and mohawk2 committed Mar 9, 2015
1 parent 5e29715 commit 6f6ace5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions extern.h
Expand Up @@ -176,9 +176,9 @@ char *cygdospath(char *src, int winpath);
#endif
#endif

/* If setvbuf is not available set output to unbuffered */
/* If setvbuf is not available, hope the OS has some buffering by default already */
#if ! HAVE_SETVBUF
# define setvbuf(fp,bp,type,len) setbuf(fp,NULL)
# define setvbuf(fp,bp,type,len)
#endif

/* coreleft is used in some debug macros. Only Turbo C seems to provide
Expand Down
1 change: 1 addition & 0 deletions win95/microsft/config.h
Expand Up @@ -100,6 +100,7 @@
#define HAVE_STRERROR 1
#define HAVE_TEMPNAM 1
#define HAVE_FCNTL_H 1
#define HAVE_SETVBUF 1

/* These defines are needed for itypes.h! (this is tested only with MSVC++ 6.0) */
#define SIZEOF_INT 4
Expand Down

0 comments on commit 6f6ace5

Please sign in to comment.