gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: patch - was: Re: [gnugo-devel] temporary development web page


From: Gunnar Farneback
Subject: Re: patch - was: Re: [gnugo-devel] temporary development web page
Date: Tue, 30 Dec 2003 14:52:21 +0100
User-agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/20.7 (sparc-sun-solaris2.7) (with unibyte mode)

Aquarius wrote:
> please consider incorporating my GTP-buffering patch for Win32/MinGW
> for use in 3.5.3. Or - instead - please mention it under:
> "Patches that may not be used"
> Doing so will at least help GNU Go users compiling with MinGW32 under Win32
> in finding the patch and decide for themselves ...

Right, this needs to be laid to rest. I'm not really happy with adding
platform-conditional code though if it can be avoided. I think we
should just give up on the line buffering. Can you test whether this
alternative patch works for you?

/Gunnar

Index: interface/play_gtp.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/interface/play_gtp.c,v
retrieving revision 1.136
diff -u -r1.136 play_gtp.c
--- interface/play_gtp.c        18 Nov 2003 08:55:47 -0000      1.136
+++ interface/play_gtp.c        30 Dec 2003 13:38:16 -0000
@@ -330,8 +330,10 @@
 void
 play_gtp(FILE *gtp_input, int gtp_initial_orientation)
 {
-  /* Set line buffering of stdout. */
-  setvbuf(stdout, (char *)NULL, _IOLBF, 0);
+  /* Make sure stdout is unbuffered. (Line buffering is also okay but
+   * not necessary. Block buffering breaks GTP mode.)
+   */
+  setbuf(stdout, NULL);
 
   /* Inform the GTP utility functions about the board size. */
   gtp_internal_set_boardsize(board_size);




reply via email to

[Prev in Thread] Current Thread [Next in Thread]