diff options
author | Scott Wegner <swegner@hdfgroup.org> | 2008-06-05 21:39:30 (GMT) |
---|---|---|
committer | Scott Wegner <swegner@hdfgroup.org> | 2008-06-05 21:39:30 (GMT) |
commit | 0b5f34bfa659d0cde87a1f120843f8003ee2a81b (patch) | |
tree | f0be04385aa11f4c7fd6c556d8ffaedf3b96bf60 /tools | |
parent | 13cc35de119303658b5facaf993632a4a57b15a4 (diff) | |
download | hdf5-0b5f34bfa659d0cde87a1f120843f8003ee2a81b.zip hdf5-0b5f34bfa659d0cde87a1f120843f8003ee2a81b.tar.gz hdf5-0b5f34bfa659d0cde87a1f120843f8003ee2a81b.tar.bz2 |
[svn-r15160] Purpose: Separate Windows function macro definitions to win32defs.h
Description:
In library code, we try not to use system calls directly, but instead use the HD{function} macro instead. This way, we can map special versions of the call on particular systems. Previously, it was all done in H5private.h. However, in an effort to clean up platform-specific definitions, we move all of the Windows macros into a separate file, win32defs.h. This way, we can use the non-Posix versions that Visual Studio sends warnings about.
Some macros are set specifically in the platform-specific header files. Then, any macros left unset will be set by the "default" implementation in H5private.h.
This checkin also cleans up various source files to use the HD* macros when possible.
Tested:
VS2005 on WinXP
VS.NET on WinXP
h5committest (kagiso, linew, smirom)
Diffstat (limited to 'tools')
-rw-r--r-- | tools/h5dump/h5dump.c | 2 | ||||
-rw-r--r-- | tools/h5jam/getub.c | 10 | ||||
-rw-r--r-- | tools/h5jam/h5jam.c | 12 | ||||
-rw-r--r-- | tools/h5jam/h5jamgentest.c | 6 | ||||
-rw-r--r-- | tools/h5jam/h5unjam.c | 14 | ||||
-rw-r--r-- | tools/h5jam/tellub.c | 2 | ||||
-rw-r--r-- | tools/lib/talign.c | 2 | ||||
-rw-r--r-- | tools/misc/h5repart.c | 18 |
8 files changed, 33 insertions, 33 deletions
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c index f0055c5..7118d10 100644 --- a/tools/h5dump/h5dump.c +++ b/tools/h5dump/h5dump.c @@ -4185,7 +4185,7 @@ main(int argc, const char *argv[]) char * ns; char *indx; - ns = strdup(xmlnsprefix); + ns = HDstrdup(xmlnsprefix); indx = strrchr(ns,(int)':'); if (indx) *indx = '\0'; diff --git a/tools/h5jam/getub.c b/tools/h5jam/getub.c index 52e349e..2fb5833 100644 --- a/tools/h5jam/getub.c +++ b/tools/h5jam/getub.c @@ -85,7 +85,7 @@ parse_command_line (int argc, const char *argv[]) switch ((char) opt) { case 'c': - nbytes = strdup (opt_arg); + nbytes = HDstrdup (opt_arg); break; case '?': default: @@ -126,7 +126,7 @@ main (int argc, const char *argv[]) usage (progname); exit (EXIT_FAILURE); } - filename = strdup (argv[opt_ind]); + filename = HDstrdup (argv[opt_ind]); size = 0; res = sscanf (nbytes, "%u", &size); @@ -148,7 +148,7 @@ main (int argc, const char *argv[]) buf = malloc ((unsigned)(size + 1)); if (buf == NULL) { - close (fd); + HDclose (fd); exit (EXIT_FAILURE); } @@ -158,7 +158,7 @@ main (int argc, const char *argv[]) { if (buf) free (buf); - close (fd); + HDclose (fd); exit (EXIT_FAILURE); } @@ -166,6 +166,6 @@ main (int argc, const char *argv[]) if (buf) free (buf); - close (fd); + HDclose (fd); return (EXIT_SUCCESS); } diff --git a/tools/h5jam/h5jam.c b/tools/h5jam/h5jam.c index f42d8fb..c6fdb5c 100644 --- a/tools/h5jam/h5jam.c +++ b/tools/h5jam/h5jam.c @@ -119,13 +119,13 @@ parse_command_line (int argc, const char *argv[]) switch ((char) opt) { case 'o': - output_file = strdup (opt_arg); + output_file = HDstrdup (opt_arg); break; case 'i': - input_file = strdup (opt_arg); + input_file = HDstrdup (opt_arg); break; case 'u': - ub_file = strdup (opt_arg); + ub_file = HDstrdup (opt_arg); break; case 'c': do_clobber = TRUE; @@ -342,9 +342,9 @@ main (int argc, const char *argv[]) where = write_pad (ofid, where); - close (ufid); - close (h5fid); - close (ofid); + HDclose (ufid); + HDclose (h5fid); + HDclose (ofid); return d_status; } diff --git a/tools/h5jam/h5jamgentest.c b/tools/h5jam/h5jamgentest.c index 908a609..0599552 100644 --- a/tools/h5jam/h5jamgentest.c +++ b/tools/h5jam/h5jamgentest.c @@ -321,7 +321,7 @@ gent_ub(const char * filename, size_t ub_size, size_t ub_fill) HDwrite(fd, buf, ub_size); - close(fd); + HDclose(fd); } } @@ -349,7 +349,7 @@ create_textfile(const char *name, size_t size) HDwrite(fd, buf, size); - close(fd); + HDclose(fd); } #ifdef notdef @@ -375,7 +375,7 @@ create_binfile(char *name, off_t size) HDwrite(fd,buf,size); - close(fd); + HDclose(fd); } #endif diff --git a/tools/h5jam/h5unjam.c b/tools/h5jam/h5unjam.c index ebfbdb2..3ab2202 100644 --- a/tools/h5jam/h5unjam.c +++ b/tools/h5jam/h5unjam.c @@ -112,13 +112,13 @@ parse_command_line(int argc, const char *argv[]) while ((opt = get_option(argc, argv, s_opts, l_opts)) != EOF) { switch ((char)opt) { case 'o': - output_file = strdup (opt_arg); + output_file = HDstrdup (opt_arg); break; case 'i': - input_file = strdup (opt_arg); + input_file = HDstrdup (opt_arg); break; case 'u': - ub_file = strdup (opt_arg); + ub_file = HDstrdup (opt_arg); break; case 'd': do_delete = TRUE; @@ -239,7 +239,7 @@ main(int argc, const char *argv[]) if (ub_file == NULL) { /* write to sdtout */ - ufid = dup(1); + ufid = HDdup(1); } else { ufid = HDopen(ub_file,O_WRONLY|O_CREAT|O_TRUNC, 0644 ); @@ -277,9 +277,9 @@ main(int argc, const char *argv[]) copy_to_file( ifid, h5fid, (ssize_t) usize, (ssize_t)(fsize - (ssize_t)usize) ); - close(ufid); - close(h5fid); - close(ifid); + HDclose(ufid); + HDclose(h5fid); + HDclose(ifid); return d_status; } diff --git a/tools/h5jam/tellub.c b/tools/h5jam/tellub.c index a5d8bbd..d39b958 100644 --- a/tools/h5jam/tellub.c +++ b/tools/h5jam/tellub.c @@ -148,7 +148,7 @@ main (int argc, const char *argv[]) return (EXIT_FAILURE); } - ifname = strdup (argv[opt_ind]); + ifname = HDstrdup (argv[opt_ind]); testval = H5Fis_hdf5 (ifname); diff --git a/tools/lib/talign.c b/tools/lib/talign.c index 25f0daa..6c1bd81 100644 --- a/tools/lib/talign.c +++ b/tools/lib/talign.c @@ -184,7 +184,7 @@ int main(void) H5Tclose(cmp3); H5Pclose(plist); H5Fclose(fil); - unlink(fname); + HDunlink(fname); fflush(stdout); return result; } diff --git a/tools/misc/h5repart.c b/tools/misc/h5repart.c index 505b9e4..f107e31 100644 --- a/tools/misc/h5repart.c +++ b/tools/misc/h5repart.c @@ -320,7 +320,7 @@ main (int argc, char *argv[]) need_write = FALSE; } else if (src_offset<src_act_size) { n = (size_t)MIN ((off_t)n, src_act_size-src_offset); - if ((nio=read (src, buf, n))<0) { + if ((nio=HDread (src, buf, n))<0) { perror ("read"); exit (1); } else if ((size_t)nio!=n) { @@ -347,7 +347,7 @@ main (int argc, char *argv[]) perror ("HDlseek"); exit (1); } - if ((nio=write (dst, buf, n))<0) { + if ((nio=HDwrite (dst, buf, n))<0) { perror ("write"); exit (1); } else if ((size_t)nio!=n) { @@ -369,7 +369,7 @@ main (int argc, char *argv[]) */ src_offset += n; if (src_offset==src_act_size) { - close (src); + HDclose (src); if (!src_is_family) { dst_offset += n; break; @@ -407,7 +407,7 @@ main (int argc, char *argv[]) perror ("HDHDlseek"); exit (1); } - if (read (dst, buf, 1)<0) { + if (HDread (dst, buf, 1)<0) { perror ("read"); exit (1); } @@ -415,12 +415,12 @@ main (int argc, char *argv[]) perror ("HDlseek"); exit (1); } - if (write (dst, buf, 1)<0) { + if (HDwrite (dst, buf, 1)<0) { perror ("write"); exit (1); } } - close (dst); + HDclose (dst); sprintf (dst_name, dst_gen_name, ++dst_membno); if ((dst=HDopen (dst_name, O_RDWR|O_CREAT|O_TRUNC, 0666))<0) { perror (dst_name); @@ -442,7 +442,7 @@ main (int argc, char *argv[]) perror ("HDlseek"); exit (1); } - if (read (dst, buf, 1)<0) { + if (HDread (dst, buf, 1)<0) { perror ("read"); exit (1); } @@ -450,12 +450,12 @@ main (int argc, char *argv[]) perror ("HDlseek"); exit (1); } - if (write (dst, buf, 1)<0) { + if (HDwrite (dst, buf, 1)<0) { perror ("write"); exit (1); } } - close (dst); + HDclose (dst); /* Modify family driver information saved in superblock through private property. * These private properties are for this tool only. */ |