catools: Disable stdout buffering on Windows

Line buffering is not supported on Windows 7.
This commit is contained in:
Andrew Johnson
2011-04-19 14:21:38 -05:00
parent f3f2f23fbc
commit 1584f98e26
5 changed files with 15 additions and 11 deletions

View File

@@ -391,7 +391,7 @@ int main (int argc, char *argv[])
int nPvs; /* Number of PVs */
pv* pvs = 0; /* Array of PV structures */
setvbuf(stdout,NULL,_IOLBF,BUFSIZ); /* Set stdout to line buffering */
LINE_BUFFER(stdout); /* Configure stdout buffering */
while ((opt = getopt(argc, argv, ":taicnhsSe:f:g:l:#:d:0:w:p:F:")) != -1) {
switch (opt) {

View File

@@ -6,8 +6,7 @@
* Operator of Los Alamos National Laboratory.
* Copyright (c) 2002 Berliner Elektronenspeicherringgesellschaft fuer
* Synchrotronstrahlung.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -136,7 +135,7 @@ int main (int argc, char *argv[])
int nPvs; /* Number of PVs */
pv* pvs = 0; /* Array of PV structures */
setvbuf(stdout,NULL,_IOLBF,BUFSIZ); /* Set stdout to line buffering */
LINE_BUFFER(stdout); /* Configure stdout buffering */
while ((opt = getopt(argc, argv, ":nhw:s:p:")) != -1) {
switch (opt) {

View File

@@ -6,8 +6,7 @@
* Operator of Los Alamos National Laboratory.
* Copyright (c) 2002 Berliner Elektronenspeicherringgesellschaft fuer
* Synchrotronstrahlung.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -214,7 +213,7 @@ int main (int argc, char *argv[])
int nPvs; /* Number of PVs */
pv* pvs = 0; /* Array of PV structures */
setvbuf(stdout,NULL,_IOLBF,BUFSIZ); /* Set stdout to line buffering */
LINE_BUFFER(stdout); /* Configure stdout buffering */
while ((opt = getopt(argc, argv, ":nhm:sSe:f:g:l:#:0:w:t:p:F:")) != -1) {
switch (opt) {

View File

@@ -275,8 +275,8 @@ int main (int argc, char *argv[])
int nPvs; /* Number of PVs */
pv* pvs = 0; /* Array of PV structures */
setvbuf(stdout,NULL,_IOLBF,BUFSIZ); /* Set stdout to line buffering */
putenv("POSIXLY_CORRECT="); /* Behave correct on GNU getopt systems */
LINE_BUFFER(stdout); /* Configure stdout buffering */
putenv("POSIXLY_CORRECT="); /* Behave correct on GNU getopt systems */
while ((opt = getopt(argc, argv, ":cnlhatsS#:w:p:F:")) != -1) {
switch (opt) {

View File

@@ -5,8 +5,7 @@
* Operator of Los Alamos National Laboratory.
* Copyright (c) 2002 Berliner Elektronenspeicherringgesellschaft fuer
* Synchrotronstrahlung.
* EPICS BASE Versions 3.13.7
* and higher are distributed subject to a Software License Agreement found
* EPICS BASE is distributed subject to a Software License Agreement found
* in file LICENSE that is included with this distribution.
\*************************************************************************/
@@ -50,6 +49,13 @@
#define DEFAULT_CA_PRIORITY 0 /* Default CA priority */
#define DEFAULT_TIMEOUT 1.0 /* Default CA timeout */
#ifndef _WIN32
# define LINE_BUFFER(stream) setvbuf(stream, NULL, _IOLBF, BUFSIZ)
#else
/* Windows doesn't support line mode, turn buffering off completely */
# define LINE_BUFFER(stream) setvbuf(stream, NULL, _IONBF, 0)
#endif
/* Type of timestamp */
typedef enum { absolute, relative, incremental, incrementalByChan } TimeT;