Document Windows lossage and work-around.
This commit is contained in:
parent
d86c6e89ff
commit
744d118768
1 changed files with 8 additions and 0 deletions
|
@ -109,6 +109,14 @@ main(int ac, char **av)
|
|||
int utf8 = 0;
|
||||
|
||||
#ifdef _WIN32
|
||||
/*
|
||||
* stdout is unbuffered under Windows if connected to a character
|
||||
* device, and putchar() screws up when printing multibyte strings
|
||||
* bytewise to an unbuffered stream. Switch stdout to line-
|
||||
* buffered mode. Unfortunately, ISO C allows implementations to
|
||||
* screw that up, and of course Windows does. Manual flushing
|
||||
* after each prompt is required.
|
||||
*/
|
||||
setvbuf(stdout, NULL, _IOLBF, 4096);
|
||||
err = WSAStartup(0x0101, &WsaData);
|
||||
if (err == SOCKET_ERROR) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue