diff options
author | MuQun Yang <ymuqun@hdfgroup.org> | 2006-03-23 02:32:21 (GMT) |
---|---|---|
committer | MuQun Yang <ymuqun@hdfgroup.org> | 2006-03-23 02:32:21 (GMT) |
commit | 36dda5514c3e077d34b526dfa059f93e978764c5 (patch) | |
tree | 11811a6b40ab1db80d1f2477399479a4134de884 /windows/src/H5pubconf.h | |
parent | d80639dda8e676cebcd12eae2f713faa518c35d2 (diff) | |
download | hdf5-36dda5514c3e077d34b526dfa059f93e978764c5.zip hdf5-36dda5514c3e077d34b526dfa059f93e978764c5.tar.gz hdf5-36dda5514c3e077d34b526dfa059f93e978764c5.tar.bz2 |
[svn-r12141] Purpose:
portable issue on windows
Description:
setvbuf on visual studio 2005 needs the size to be greater or equal to 2.
<description of setvbuf from msdn library>
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:
Diffstat (limited to 'windows/src/H5pubconf.h')
-rwxr-xr-x | windows/src/H5pubconf.h | 11 |
1 files changed, 11 insertions, 0 deletions
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 */ |