From 3b7ad1820d467b8a2453c4da9d10c6756bfaf957 Mon Sep 17 00:00:00 2001 From: Wilson Snyder Date: Wed, 9 Feb 2022 21:35:18 -0500 Subject: [PATCH] GTKWave header updates from upstream. --- include/gtkwave/fstapi.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/include/gtkwave/fstapi.c b/include/gtkwave/fstapi.c index 2e28e64ac..b19e0bcaa 100644 --- a/include/gtkwave/fstapi.c +++ b/include/gtkwave/fstapi.c @@ -140,6 +140,10 @@ void **JenkinsIns(void *base_i, const unsigned char *mem, uint32_t length, uint3 #include #endif +#if defined(FST_MACOSX) || defined(__MINGW32__) || defined(__OpenBSD__) || defined(__FreeBSD__) +#define FST_UNBUFFERED_IO +#endif + #ifdef __GNUC__ /* Boolean expression more often true than false */ #define FST_LIKELY(x) __builtin_expect(!!(x), 1) @@ -4577,12 +4581,11 @@ if(sectype == FST_BL_ZWRAPPER) if(!fcomp) { tmpfile_close(&fcomp, &xc->f_nam); return(0); } } -#if defined(FST_MACOSX) +#if defined(FST_UNBUFFERED_IO) setvbuf(fcomp, (char *)NULL, _IONBF, 0); /* keeps gzip from acting weird in tandem with fopen */ #endif #ifdef __MINGW32__ - setvbuf(fcomp, (char *)NULL, _IONBF, 0); /* keeps gzip from acting weird in tandem with fopen */ xc->filename_unpacked = hf; #else if(hf) @@ -4880,7 +4883,7 @@ if((!nam)||(!(xc->f=fopen(nam, "rb")))) char *hf = (char *)calloc(1, flen + 6); int rc; -#if defined(__MINGW32__) || defined(FST_MACOSX) +#if defined(FST_UNBUFFERED_IO) setvbuf(xc->f, (char *)NULL, _IONBF, 0); /* keeps gzip from acting weird in tandem with fopen */ #endif