From 22ffac1b1f8288bac7a277a8caa04ca731a54b81 Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Fri, 6 Mar 1998 15:30:39 +0000 Subject: Don't use setvbuf unless HAVE_SETVBUF is defined. --- Modules/main.c | 16 ++++++++++++---- 1 file changed, 12 insertions(+), 4 deletions(-) diff --git a/Modules/main.c b/Modules/main.c index 83fd9dc..b62597a 100644 --- a/Modules/main.c +++ b/Modules/main.c @@ -205,25 +205,33 @@ Py_Main(argc, argv) _setmode(fileno(stdout), O_BINARY); #endif #ifndef MPW +#ifdef HAVE_SETVBUF setvbuf(stdin, (char *)NULL, _IONBF, BUFSIZ); setvbuf(stdout, (char *)NULL, _IONBF, BUFSIZ); setvbuf(stderr, (char *)NULL, _IONBF, BUFSIZ); -#else +#else /* !HAVE_SETVBUF */ + setbuf(stdin, (char *)NULL); + setbuf(stdout, (char *)NULL); + setbuf(stderr, (char *)NULL); +#endif /* !HAVE_SETVBUF */ +#else /* MPW */ /* On MPW (3.2) unbuffered seems to hang */ setvbuf(stdin, (char *)NULL, _IOLBF, BUFSIZ); setvbuf(stdout, (char *)NULL, _IOLBF, BUFSIZ); setvbuf(stderr, (char *)NULL, _IOLBF, BUFSIZ); -#endif +#endif /* MPW */ } else if (Py_InteractiveFlag) { #ifdef MS_WINDOWS /* Doesn't have to have line-buffered -- use unbuffered */ setvbuf(stdin, (char *)NULL, _IONBF, BUFSIZ); setvbuf(stdout, (char *)NULL, _IONBF, BUFSIZ); -#else +#else /* !MS_WINDOWS */ +#ifdef HAVE_SETVBUF setvbuf(stdin, (char *)NULL, _IOLBF, BUFSIZ); setvbuf(stdout, (char *)NULL, _IOLBF, BUFSIZ); -#endif +#endif /* HAVE_SETVBUF */ +#endif /* !MS_WINDOWS */ /* Leave stderr alone - it should be unbuffered anyway. */ } -- cgit v0.12