From 36dda5514c3e077d34b526dfa059f93e978764c5 Mon Sep 17 00:00:00 2001 From: MuQun Yang Date: Wed, 22 Mar 2006 21:32:21 -0500 Subject: [svn-r12141] Purpose: portable issue on windows Description: setvbuf on visual studio 2005 needs the size to be greater or equal to 2. Buffer size in bytes. Allowable range: 2 <= size <= INT_MAX (2147483647). Internally, the value supplied for size is rounded down to the nearest multiple of 2. h5import used linebuffer option of setvbuf for stderr and stdout and the size is 0 by default. This causes core dump with visual 2005 on windows 64-bit. Solution: 1. Use HDsetvbuf inside h5import.c, 2. Define HDsetvbuf inside windows H5pubconf.h for windows to work around the core dump of h5import test. This is probably a bug inside visual studio 2005. Platforms tested: h5commit(shanti is down) VS 6.0 on windows XP VS 8.0 on windows XP-64bit Misc. update: --- windows/src/H5pubconf.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/windows/src/H5pubconf.h b/windows/src/H5pubconf.h index bbef4a3..a702523 100755 --- a/windows/src/H5pubconf.h +++ b/windows/src/H5pubconf.h @@ -152,6 +152,17 @@ in the file file_io.win32.c and including it on the projects /* Check exception handling functions during data conversions */ #define H5_WANT_DCONV_EXCEPTION 1 +#if _MSC_VER >=1400 +/* visual studio 2005 doesn't support size of setvbuf to be less thn 1,This is a hacking, we would like to wait +visual studio 2005 to fix this problem. +*/ + +#define HDsetvbuf(F,S,M,Z) (((Z)>1)?setvbuf(F,S,M,Z):setvbuf(F,S,M,2)) + +#else +#define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,Z) +#endif + /* uncomment the following line if we want parallel HDF5 support */ /* #define H5_HAVE_PARALLEL */ -- cgit v0.12