summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorScott Wegner <swegner@hdfgroup.org>2008-06-05 18:52:19 (GMT)
committerScott Wegner <swegner@hdfgroup.org>2008-06-05 18:52:19 (GMT)
commit532e23b808886527c6037c876ea6b203db16bcff (patch)
tree34f6a6c3e945a6ce9461a7b880f3b890c364ddd2
parent92d070ab393fdd64267dfe53f55d39ef17c52257 (diff)
downloadhdf5-532e23b808886527c6037c876ea6b203db16bcff.zip
hdf5-532e23b808886527c6037c876ea6b203db16bcff.tar.gz
hdf5-532e23b808886527c6037c876ea6b203db16bcff.tar.bz2
[svn-r15150] 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)
-rw-r--r--MANIFEST1
-rw-r--r--perform/iopipe.c8
-rw-r--r--src/H5FDlog.c4
-rw-r--r--src/H5private.h1206
-rw-r--r--src/win32defs.h56
-rw-r--r--test/dtypes.c4
-rw-r--r--test/external.c30
-rw-r--r--test/fillval.c4
-rw-r--r--test/hyperslab.c18
-rw-r--r--tools/h5dump/h5dump.c2
-rw-r--r--tools/h5jam/getub.c10
-rw-r--r--tools/h5jam/h5jam.c12
-rw-r--r--tools/h5jam/h5jamgentest.c6
-rw-r--r--tools/h5jam/h5unjam.c14
-rw-r--r--tools/h5jam/tellub.c2
-rw-r--r--tools/lib/talign.c2
-rw-r--r--tools/misc/h5repart.c18
-rw-r--r--windows/proj/property_sheets/remove-posix-warnings.vsprops2
18 files changed, 947 insertions, 452 deletions
diff --git a/MANIFEST b/MANIFEST
index 1be4386..19ad8ba 100644
--- a/MANIFEST
+++ b/MANIFEST
@@ -741,6 +741,7 @@
./src/Makefile.in
./src/hdf5.h
./src/libhdf5.settings.in
+./src/win32defs.h
./test/COPYING
./test/Makefile.am
diff --git a/perform/iopipe.c b/perform/iopipe.c
index d736f17..0667995 100644
--- a/perform/iopipe.c
+++ b/perform/iopipe.c
@@ -326,9 +326,9 @@ printf("Before getrusage() call\n");
for (i=0; i<nwrite; i++) {
putc (PROGRESS, stderr);
fflush (stderr);
- offset = lseek (fd, (off_t)0, SEEK_SET);
+ offset = HDlseek (fd, (off_t)0, SEEK_SET);
assert (0==offset);
- n = write (fd, the_data, (size_t)(size[0]*size[1]));
+ n = HDwrite (fd, the_data, (size_t)(size[0]*size[1]));
assert (n>=0 && (size_t)n==size[0]*size[1]);
}
#ifdef H5_HAVE_GETRUSAGE
@@ -405,9 +405,9 @@ printf("Before getrusage() call\n");
for (i=0; i<nread; i++) {
putc (PROGRESS, stderr);
fflush (stderr);
- offset = lseek (fd, (off_t)0, SEEK_SET);
+ offset = HDlseek (fd, (off_t)0, SEEK_SET);
assert (0==offset);
- n = read (fd, the_data, (size_t)(size[0]*size[1]));
+ n = HDread (fd, the_data, (size_t)(size[0]*size[1]));
assert (n>=0 && (size_t)n==size[0]*size[1]);
}
#ifdef H5_HAVE_GETRUSAGE
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index df07c0a..dee4581 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -628,7 +628,7 @@ H5FD_log_close(H5FD_t *_file)
if(file->fa.flags&H5FD_LOG_TIME_CLOSE)
HDgettimeofday(&timeval_start,NULL);
#endif /* H5_HAVE_GETTIMEOFDAY */
- if (close(file->fd)<0)
+ if (HDclose(file->fd)<0)
HGOTO_ERROR(H5E_IO, H5E_CANTCLOSEFILE, FAIL, "unable to close file")
#ifdef H5_HAVE_GETTIMEOFDAY
if(file->fa.flags&H5FD_LOG_TIME_CLOSE)
@@ -1331,7 +1331,7 @@ H5FD_log_flush(H5FD_t *_file, hid_t UNUSED dxpl_id, unsigned UNUSED closing)
if(file->eoa>file->eof) {
if(-1 == file_seek(file->fd, (file_offset_t)(file->eoa - 1), SEEK_SET))
HGOTO_ERROR(H5E_IO, H5E_SEEKERROR, FAIL, "unable to seek to proper position")
- if(write(file->fd, "", (size_t)1) != 1)
+ if(HDwrite(file->fd, "", (size_t)1) != 1)
HGOTO_ERROR(H5E_IO, H5E_WRITEERROR, FAIL, "file write failed")
file->eof = file->eoa;
file->pos = file->eoa;
diff --git a/src/H5private.h b/src/H5private.h
index b60c50a..b6a65f3 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -495,429 +495,867 @@ typedef struct {
* Redefine all the POSIX functions. We should never see a POSIX
* function (or any other non-HDF5 function) in the source!
*/
-#define HDabort() abort()
-#define HDabs(X) abs(X)
-#define HDaccess(F,M) access(F, M)
-#define HDacos(X) acos(X)
-#ifdef H5_HAVE_ALARM
-#define HDalarm(N) alarm(N)
-#else /* H5_HAVE_ALARM */
-#define HDalarm(N) (0)
-#endif /* H5_HAVE_ALARM */
-#define HDasctime(T) asctime(T)
-#define HDasin(X) asin(X)
-#define HDassert(X) assert(X)
-#define HDatan(X) atan(X)
-#define HDatan2(X,Y) atan2(X,Y)
-#define HDatexit(F) atexit(F)
-#define HDatof(S) atof(S)
-#define HDatoi(S) atoi(S)
-#define HDatol(S) atol(S)
-#define HDBSDgettimeofday(S,P) BSDgettimeofday(S,P)
-#define HDbsearch(K,B,N,Z,F) bsearch(K,B,N,Z,F)
-#define HDcalloc(N,Z) calloc(N,Z)
-#define HDceil(X) ceil(X)
-#define HDcfgetispeed(T) cfgetispeed(T)
-#define HDcfgetospeed(T) cfgetospeed(T)
-#define HDcfsetispeed(T,S) cfsetispeed(T,S)
-#define HDcfsetospeed(T,S) cfsetospeed(T,S)
-#define HDchdir(S) chdir(S)
-#define HDchmod(S,M) chmod(S,M)
-#define HDchown(S,O,G) chown(S,O,G)
-#define HDclearerr(F) clearerr(F)
-#define HDclock() clock()
-#define HDclose(F) close(F)
-#define HDclosedir(D) closedir(D)
-#define HDcos(X) cos(X)
-#define HDcosh(X) cosh(X)
-#define HDcreat(S,M) creat(S,M)
-#define HDctermid(S) ctermid(S)
-#define HDctime(T) ctime(T)
-#define HDcuserid(S) cuserid(S)
-#ifdef H5_HAVE_DIFFTIME
-#define HDdifftime(X,Y) difftime(X,Y)
-#else
-#define HDdifftime(X,Y) ((double)(X)-(double)(Y))
-#endif
-#define HDdiv(X,Y) div(X,Y)
-#define HDdup(F) dup(F)
-#define HDdup2(F,I) dup2(F,I)
+
+ /* Use platform-specific versions if necessary */
+#include "win32defs.h"
+
+#ifndef HDabort
+ #define HDabort() abort()
+#endif /* HDabort */
+#ifndef HDabs
+ #define HDabs(X) abs(X)
+#endif /* HDabs */
+#ifndef HDaccess
+ #define HDaccess(F,M) access(F, M)
+#endif /* HDaccess */
+#ifndef HDacos
+ #define HDacos(X) acos(X)
+#endif /* HDacos */
+#ifndef HDalarm
+ #ifdef H5_HAVE_ALARM
+ #define HDalarm(N) alarm(N)
+ #else /* H5_HAVE_ALARM */
+ #define HDalarm(N) (0)
+ #endif /* H5_HAVE_ALARM */
+#endif /* HDalarm */
+#ifndef HDasctime
+ #define HDasctime(T) asctime(T)
+#endif /* HDasctime */
+#ifndef HDasin
+ #define HDasin(X) asin(X)
+#endif /* HDasin */
+#ifndef HDassert
+ #define HDassert(X) assert(X)
+#endif /* HDassert */
+#ifndef HDatan
+ #define HDatan(X) atan(X)
+#endif /* HDatan */
+#ifndef HDatan2
+ #define HDatan2(X,Y) atan2(X,Y)
+#endif /* HDatan2 */
+#ifndef HDatexit
+ #define HDatexit(F) atexit(F)
+#endif /* HDatexit */
+#ifndef HDatof
+ #define HDatof(S) atof(S)
+#endif /* HDatof */
+#ifndef HDatoi
+ #define HDatoi(S) atoi(S)
+#endif /* HDatoi */
+#ifndef HDatol
+ #define HDatol(S) atol(S)
+#endif /* HDatol */
+#ifndef HDBSDgettimeofday
+ #define HDBSDgettimeofday(S,P) BSDgettimeofday(S,P)
+#endif /* HDBSDgettimeofday */
+#ifndef HDbsearch
+ #define HDbsearch(K,B,N,Z,F) bsearch(K,B,N,Z,F)
+#endif /* HDbsearch */
+#ifndef HDcalloc
+ #define HDcalloc(N,Z) calloc(N,Z)
+#endif /* HDcalloc */
+#ifndef HDceil
+ #define HDceil(X) ceil(X)
+#endif /* HDceil */
+#ifndef HDcfgetispeed
+ #define HDcfgetispeed(T) cfgetispeed(T)
+#endif /* HDcfgetispeed */
+#ifndef HDcfgetospeed
+ #define HDcfgetospeed(T) cfgetospeed(T)
+#endif /* HDcfgetospeed */
+#ifndef HDcfsetispeed
+ #define HDcfsetispeed(T,S) cfsetispeed(T,S)
+#endif /* HDcfsetispeed */
+#ifndef HDcfsetospeed
+ #define HDcfsetospeed(T,S) cfsetospeed(T,S)
+#endif /* HDcfsetospeed */
+#ifndef HDchdir
+ #define HDchdir(S) chdir(S)
+#endif /* HDchdir */
+#ifndef HDchmod
+ #define HDchmod(S,M) chmod(S,M)
+#endif /* HDchmod */
+#ifndef HDchown
+ #define HDchown(S,O,G) chown(S,O,G)
+#endif /* HDchown */
+#ifndef HDclearerr
+ #define HDclearerr(F) clearerr(F)
+#endif /* HDclearerr */
+#ifndef HDclock
+ #define HDclock() clock()
+#endif /* HDclock */
+#ifndef HDclose
+ #define HDclose(F) close(F)
+#endif /* HDclose */
+#ifndef HDclosedir
+ #define HDclosedir(D) closedir(D)
+#endif /* HDclosedir */
+#ifndef HDcos
+ #define HDcos(X) cos(X)
+#endif /* HDcos */
+#ifndef HDcosh
+ #define HDcosh(X) cosh(X)
+#endif /* HDcosh */
+#ifndef HDcreat
+ #define HDcreat(S,M) creat(S,M)
+#endif /* HDcreat */
+#ifndef HDctermid
+ #define HDctermid(S) ctermid(S)
+#endif /* HDctermid */
+#ifndef HDctime
+ #define HDctime(T) ctime(T)
+#endif /* HDctime */
+#ifndef HDcuserid
+ #define HDcuserid(S) cuserid(S)
+#endif /* HDcuserid */
+#ifndef HDdifftime
+ #ifdef H5_HAVE_DIFFTIME
+ #define HDdifftime(X,Y) difftime(X,Y)
+ #else /* H5_HAVE_DIFFTIME */
+ #define HDdifftime(X,Y) ((double)(X)-(double)(Y))
+ #endif /* H5_HAVE_DIFFTIME */
+#endif /* HDdifftime */
+#ifndef HDdiv
+ #define HDdiv(X,Y) div(X,Y)
+#endif /* HDdiv */
+#ifndef HDdup
+ #define HDdup(F) dup(F)
+#endif /* HDdup */
+#ifndef HDdup2
+ #define HDdup2(F,I) dup2(F,I)
+#endif /* HDdup2 */
/* execl() variable arguments */
/* execle() variable arguments */
/* execlp() variable arguments */
-#define HDexecv(S,AV) execv(S,AV)
-#define HDexecve(S,AV,E) execve(S,AV,E)
-#define HDexecvp(S,AV) execvp(S,AV)
-#define HDexit(N) exit(N)
-#if defined __MWERKS__
-#include <abort_exit.h>
-#define HD_exit(N) __exit(N)
-#else /* __MWERKS __ */
-#define HD_exit(N) _exit(N)
-#endif /* __MWERKS __ */
-#define HDexp(X) exp(X)
-#define HDfabs(X) fabs(X)
+#ifndef HDexecv
+ #define HDexecv(S,AV) execv(S,AV)
+#endif /* HDexecv */
+#ifndef HDexecve
+ #define HDexecve(S,AV,E) execve(S,AV,E)
+#endif /* HDexecve */
+#ifndef HDexecvp
+ #define HDexecvp(S,AV) execvp(S,AV)
+#endif /* HDexecvp */
+#ifndef HDexit
+ #define HDexit(N) exit(N)
+#endif /* HDexit */
+#ifndef HD_exit
+ #define HD_exit(N) _exit(N)
+#endif /* HD_exit */
+#ifndef HDexp
+ #define HDexp(X) exp(X)
+#endif /* HDexp */
+#ifndef HDfabs
+ #define HDfabs(X) fabs(X)
+#endif /* HDfabs */
/* use ABS() because fabsf() fabsl() are not common yet. */
-#define HDfabsf(X) ABS(X)
-#define HDfabsl(X) ABS(X)
-#define HDfclose(F) fclose(F)
+#ifndef HDfabsf
+ #define HDfabsf(X) ABS(X)
+#endif /* HDfabsf */
+#ifndef HDfabsl
+ #define HDfabsl(X) ABS(X)
+#endif /* HDfabsl */
+#ifndef HDfclose
+ #define HDfclose(F) fclose(F)
+#endif /* HDfclose */
/* fcntl() variable arguments */
-#define HDfdopen(N,S) fdopen(N,S)
-#define HDfeof(F) feof(F)
-#define HDferror(F) ferror(F)
-#define HDfflush(F) fflush(F)
-#define HDfgetc(F) fgetc(F)
-#define HDfgetpos(F,P) fgetpos(F,P)
-#define HDfgets(S,N,F) fgets(S,N,F)
-#ifdef _WIN32
-#define HDfileno(F) _fileno(F)
-#else /* _WIN32 */
-#define HDfileno(F) fileno(F)
-#endif /* _WIN32 */
-#define HDfloor(X) floor(X)
-#define HDfmod(X,Y) fmod(X,Y)
-#define HDfopen(S,M) fopen(S,M)
-#define HDfork() fork()
-#define HDfpathconf(F,N) fpathconf(F,N)
+#ifndef HDfdopen
+ #define HDfdopen(N,S) fdopen(N,S)
+#endif /* HDfdopen */
+#ifndef HDfeof
+ #define HDfeof(F) feof(F)
+#endif /* HDfeof */
+#ifndef HDferror
+ #define HDferror(F) ferror(F)
+#endif /* HDferror */
+#ifndef HDfflush
+ #define HDfflush(F) fflush(F)
+#endif /* HDfflush */
+#ifndef HDfgetc
+ #define HDfgetc(F) fgetc(F)
+#endif /* HDfgetc */
+#ifndef HDfgetpos
+ #define HDfgetpos(F,P) fgetpos(F,P)
+#endif /* HDfgetpos */
+#ifndef HDfgets
+ #define HDfgets(S,N,F) fgets(S,N,F)
+#endif /* HDfgets */
+#ifndef HDfileno
+ #define HDfileno(F) fileno(F)
+#endif /* HDfileno */
+#ifndef HDfloor
+ #define HDfloor(X) floor(X)
+#endif /* HDfloor */
+#ifndef HDfmod
+ #define HDfmod(X,Y) fmod(X,Y)
+#endif /* HDfmod */
+#ifndef HDfopen
+ #define HDfopen(S,M) fopen(S,M)
+#endif /* HDfopen */
+#ifndef HDfork
+ #define HDfork() fork()
+#endif /* HDfork */
+#ifndef HDfpathconf
+ #define HDfpathconf(F,N) fpathconf(F,N)
+#endif /* HDfpathconf */
H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
-#define HDfputc(C,F) fputc(C,F)
-#define HDfputs(S,F) fputs(S,F)
-#define HDfread(M,Z,N,F) fread(M,Z,N,F)
-#define HDfree(M) free(M)
-#define HDfreopen(S,M,F) freopen(S,M,F)
-#define HDfrexp(X,N) frexp(X,N)
+#ifndef HDfputc
+ #define HDfputc(C,F) fputc(C,F)
+#endif /* HDfputc */
+#ifndef HDfputs
+ #define HDfputs(S,F) fputs(S,F)
+#endif /* HDfputs */
+#ifndef HDfread
+ #define HDfread(M,Z,N,F) fread(M,Z,N,F)
+#endif /* HDfread */
+#ifndef HDfree
+ #define HDfree(M) free(M)
+#endif /* HDfree */
+#ifndef HDfreopen
+ #define HDfreopen(S,M,F) freopen(S,M,F)
+#endif /* HDfreopen */
+#ifndef HDfrexp
+ #define HDfrexp(X,N) frexp(X,N)
+#endif /* HDfrexp */
/* Check for Cray-specific 'frexpf()' and 'frexpl()' routines */
-#ifdef H5_HAVE_FREXPF
-#define HDfrexpf(X,N) frexpf(X,N)
-#else /* H5_HAVE_FREXPF */
-#define HDfrexpf(X,N) frexp(X,N)
-#endif /* H5_HAVE_FREXPF */
-#ifdef H5_HAVE_FREXPL
-#define HDfrexpl(X,N) frexpl(X,N)
-#else /* H5_HAVE_FREXPL */
-#define HDfrexpl(X,N) frexp(X,N)
-#endif /* H5_HAVE_FREXPL */
+#ifndef HDfrexpf
+ #ifdef H5_HAVE_FREXPF
+ #define HDfrexpf(X,N) frexpf(X,N)
+ #else /* H5_HAVE_FREXPF */
+ #define HDfrexpf(X,N) frexp(X,N)
+ #endif /* H5_HAVE_FREXPF */
+#endif /* HDfrexpf */
+#ifndef HDfrexpl
+ #ifdef H5_HAVE_FREXPL
+ #define HDfrexpl(X,N) frexpl(X,N)
+ #else /* H5_HAVE_FREXPL */
+ #define HDfrexpl(X,N) frexp(X,N)
+ #endif /* H5_HAVE_FREXPL */
+#endif /* HDfrexpl */
/* fscanf() variable arguments */
-#ifdef H5_HAVE_FSEEKO
- #define HDfseek(F,O,W) fseeko(F,O,W)
-#else
- #define HDfseek(F,O,W) fseek(F,O,W)
-#endif
-#define HDfsetpos(F,P) fsetpos(F,P)
+#ifndef HDfseek
+ #ifdef H5_HAVE_FSEEKO
+ #define HDfseek(F,O,W) fseeko(F,O,W)
+ #else /* H5_HAVE_FSEEKO */
+ #define HDfseek(F,O,W) fseek(F,O,W)
+ #endif /* H5_HAVE_FSEEKO */
+#endif /* HDfseek */
+#ifndef HDfsetpos
+ #define HDfsetpos(F,P) fsetpos(F,P)
+#endif /* HDfsetpos */
/* definitions related to the file stat utilities.
- * Windows have its own function names.
* For Unix, if off_t is not 64bit big, try use the pseudo-standard
* xxx64 versions if available.
*/
-#ifdef _WIN32
- #ifdef __MWERKS__
- #define HDfstat(F,B) fstat(F,B)
- #define HDstat(S,B) stat(S,B)
- typedef struct stat h5_stat_t;
- typedef off_t h5_stat_size_t;
- #else /*MSVC*/
- #define HDfstat(F,B) _fstati64(F,B)
- #define HDstat(S,B) _stati64(S,B)
- typedef struct _stati64 h5_stat_t;
- typedef __int64 h5_stat_size_t;
+#if !defined(HDfstat) || !defined(HDstat)
+ #if H5_SIZEOF_OFF_T!=8 && H5_SIZEOF_OFF64_T==8 && defined(H5_HAVE_STAT64)
+ #ifndef HDfstat
+ #define HDfstat(F,B) fstat64(F,B)
+ #endif /* HDfstat */
+ #ifndef HDstat
+ #define HDstat(S,B) stat64(S,B)
+ #endif /* HDstat */
+ typedef struct stat64 h5_stat_t;
+ typedef off64_t h5_stat_size_t;
+ #else /* H5_SIZEOF_OFF_T!=8 && ... */
+ #ifndef HDfstat
+ #define HDfstat(F,B) fstat(F,B)
+ #endif /* HDfstat */
+ #ifndef HDstat
+ #define HDstat(S,B) stat(S,B)
+ #endif /* HDstat */
+ typedef struct stat h5_stat_t;
+ typedef off_t h5_stat_size_t;
+ #endif /* H5_SIZEOF_OFF_T!=8 && ... */
+#endif /* !defined(HDfstat) || !defined(HDstat) */
+
+#ifndef HDftell
+ #define HDftell(F) ftell(F)
+#endif /* HDftell */
+#ifndef HDftruncate
+ #define HDftruncate(F,L) ftruncate(F,L)
+#endif /* HDftruncate */
+#ifndef HDfwrite
+ #define HDfwrite(M,Z,N,F) fwrite(M,Z,N,F)
+#endif /* HDfwrite */
+#ifndef HDgetc
+ #define HDgetc(F) getc(F)
+#endif /* HDgetc */
+#ifndef HDgetchar
+ #define HDgetchar() getchar()
+#endif /* HDgetchar */
+#ifndef HDgetcwd
+ #define HDgetcwd(S,Z) getcwd(S,Z)
+#endif /* HDgetcwd */
+#ifndef HDgetdcwd
+ #define HDgetdcwd(D,S,Z) getcwd(S,Z)
+#endif /* HDgetdcwd */
+#ifndef HDgetdrive
+ #define HDgetdrive() 0
+#endif /* HDgetdrive */
+#ifndef HDgetegid
+ #define HDgetegid() getegid()
+#endif /* HDgetegid() */
+#ifndef HDgetenv
+ #define HDgetenv(S) getenv(S)
+#endif /* HDgetenv */
+#ifndef HDgeteuid
+ #define HDgeteuid() geteuid()
+#endif /* HDgeteuid */
+#ifndef HDgetgid
+ #define HDgetgid() getgid()
+#endif /* HDgetgid */
+#ifndef HDgetgrgid
+ #define HDgetgrgid(G) getgrgid(G)
+#endif /* HDgetgrgid */
+#ifndef HDgetgrnam
+ #define HDgetgrnam(S) getgrnam(S)
+#endif /* HDgetgrnam */
+#ifndef HDgetgroups
+ #define HDgetgroups(Z,G) getgroups(Z,G)
+#endif /* HDgetgroups */
+#ifndef HDgetlogin
+ #define HDgetlogin() getlogin()
+#endif /* HDgetlogin */
+#ifndef HDgetpgrp
+ #define HDgetpgrp() getpgrp()
+#endif /* HDgetpgrp */
+#ifndef HDgetpid
+ #define HDgetpid() getpid()
+#endif /* HDgetpid */
+#ifndef HDgetppid
+ #define HDgetppid() getppid()
+#endif /* HDgetppid */
+#ifndef HDgetpwnam
+ #define HDgetpwnam(S) getpwnam(S)
+#endif /* HDgetpwnam */
+#ifndef HDgetpwuid
+ #define HDgetpwuid(U) getpwuid(U)
+#endif /* HDgetpwuid */
+#ifndef HDgetrusage
+ #define HDgetrusage(X,S) getrusage(X,S)
+#endif /* HDgetrusage */
+#ifndef HDgets
+ #define HDgets(S) gets(S)
+#endif /* HDgets */
+#ifndef HDgettimeofday
+ #define HDgettimeofday(S,P) gettimeofday(S,P)
+#endif /* HDgettimeofday */
+#ifndef HDgetuid
+ #define HDgetuid() getuid()
+#endif /* HDgetuid */
+#ifndef HDgmtime
+ #define HDgmtime(T) gmtime(T)
+#endif /* HDgmtime */
+#ifndef HDisalnum
+ #define HDisalnum(C) isalnum((int)(C)) /*cast for solaris warning*/
+#endif /* HDisalnum */
+#ifndef HDisalpha
+ #define HDisalpha(C) isalpha((int)(C)) /*cast for solaris warning*/
+#endif /* HDisalpha */
+#ifndef HDisatty
+ #define HDisatty(F) isatty(F)
+#endif /* HDisatty */
+#ifndef HDiscntrl
+ #define HDiscntrl(C) iscntrl((int)(C)) /*cast for solaris warning*/
+#endif /* HDiscntrl */
+#ifndef HDisdigit
+ #define HDisdigit(C) isdigit((int)(C)) /*cast for solaris warning*/
+#endif /* HDisdigit */
+#ifndef HDisgraph
+ #define HDisgraph(C) isgraph((int)(C)) /*cast for solaris warning*/
+#endif /* HDisgraph */
+#ifndef HDislower
+ #define HDislower(C) islower((int)(C)) /*cast for solaris warning*/
+#endif /* HDislower */
+#ifndef HDisprint
+ #define HDisprint(C) isprint((int)(C)) /*cast for solaris warning*/
+#endif /* HDisprint */
+#ifndef HDispunct
+ #define HDispunct(C) ispunct((int)(C)) /*cast for solaris warning*/
+#endif /* HDispunct */
+#ifndef HDisspace
+ #define HDisspace(C) isspace((int)(C)) /*cast for solaris warning*/
+#endif /* HDisspace */
+#ifndef HDisupper
+ #define HDisupper(C) isupper((int)(C)) /*cast for solaris warning*/
+#endif /* HDisupper */
+#ifndef HDisxdigit
+ #define HDisxdigit(C) isxdigit((int)(C)) /*cast for solaris warning*/
+#endif /* HDisxdigit */
+#ifndef HDkill
+ #define HDkill(P,S) kill(P,S)
+#endif /* HDkill */
+#ifndef HDlabs
+ #define HDlabs(X) labs(X)
+#endif /* HDlabs */
+#ifndef HDldexp
+ #define HDldexp(X,N) ldexp(X,N)
+#endif /* HDldexp */
+#ifndef HDldiv
+ #define HDldiv(X,Y) ldiv(X,Y)
+#endif /* HDldiv */
+#ifndef HDlink
+ #define HDlink(OLD,NEW) link(OLD,NEW)
+#endif /* HDlink */
+#ifndef HDlocaleconv
+ #define HDlocaleconv() localeconv()
+#endif /* HDlocaleconv */
+#ifndef HDlocaltime
+ #define HDlocaltime(T) localtime(T)
+#endif /* HDlocaltime */
+#ifndef HDlog
+ #define HDlog(X) log(X)
+#endif /* HDlog */
+#ifndef HDlog10
+ #define HDlog10(X) log10(X)
+#endif /* HDlog10 */
+#ifndef HDlongjmp
+ #define HDlongjmp(J,N) longjmp(J,N)
+#endif /* HDlongjmp */
+#ifndef HDlseek
+ #ifdef H5_HAVE_FSEEK64
+ #define HDlseek(F,O,W) lseek64(F,O,W)
+ #else
+ #define HDlseek(F,O,W) lseek(F,O,W)
#endif
-#elif H5_SIZEOF_OFF_T!=8 && H5_SIZEOF_OFF64_T==8 && defined(H5_HAVE_STAT64)
- #define HDfstat(F,B) fstat64(F,B)
- #define HDstat(S,B) stat64(S,B)
- typedef struct stat64 h5_stat_t;
- typedef off64_t h5_stat_size_t;
-#else
- #define HDfstat(F,B) fstat(F,B)
- #define HDstat(S,B) stat(S,B)
- typedef struct stat h5_stat_t;
- typedef off_t h5_stat_size_t;
-#endif
-
-#define HDftell(F) ftell(F)
-#define HDftruncate(F,L) ftruncate(F,L)
-#define HDfwrite(M,Z,N,F) fwrite(M,Z,N,F)
-#define HDgetc(F) getc(F)
-#define HDgetchar() getchar()
-#ifdef _WIN32
-#define HDgetcwd(S,Z) _getcwd(S,Z)
-#define HDgetdcwd(D,S,Z) _getdcwd(D,S,Z)
-#define HDgetdrive() _getdrive()
-#else
-#define HDgetcwd(S,Z) getcwd(S,Z)
-#define HDgetdcwd(D,S,Z) getcwd(S,Z)
-#define HDgetdrive() 0
-#endif
-#define HDgetegid() getegid()
-#define HDgetenv(S) getenv(S)
-#define HDgeteuid() geteuid()
-#define HDgetgid() getgid()
-#define HDgetgrgid(G) getgrgid(G)
-#define HDgetgrnam(S) getgrnam(S)
-#define HDgetgroups(Z,G) getgroups(Z,G)
-#define HDgetlogin() getlogin()
-#define HDgetpgrp() getpgrp()
-#define HDgetpid() getpid()
-#define HDgetppid() getppid()
-#define HDgetpwnam(S) getpwnam(S)
-#define HDgetpwuid(U) getpwuid(U)
-#define HDgetrusage(X,S) getrusage(X,S)
-#define HDgets(S) gets(S)
-#define HDgettimeofday(S,P) gettimeofday(S,P)
-#define HDgetuid() getuid()
-#define HDgmtime(T) gmtime(T)
-#define HDisalnum(C) isalnum((int)(C)) /*cast for solaris warning*/
-#define HDisalpha(C) isalpha((int)(C)) /*cast for solaris warning*/
-#define HDisatty(F) isatty(F)
-#define HDiscntrl(C) iscntrl((int)(C)) /*cast for solaris warning*/
-#define HDisdigit(C) isdigit((int)(C)) /*cast for solaris warning*/
-#define HDisgraph(C) isgraph((int)(C)) /*cast for solaris warning*/
-#define HDislower(C) islower((int)(C)) /*cast for solaris warning*/
-#define HDisprint(C) isprint((int)(C)) /*cast for solaris warning*/
-#define HDispunct(C) ispunct((int)(C)) /*cast for solaris warning*/
-#define HDisspace(C) isspace((int)(C)) /*cast for solaris warning*/
-#define HDisupper(C) isupper((int)(C)) /*cast for solaris warning*/
-#define HDisxdigit(C) isxdigit((int)(C)) /*cast for solaris warning*/
-#define HDkill(P,S) kill(P,S)
-#define HDlabs(X) labs(X)
-#define HDldexp(X,N) ldexp(X,N)
-#define HDldiv(X,Y) ldiv(X,Y)
-#define HDlink(OLD,NEW) link(OLD,NEW)
-#define HDlocaleconv() localeconv()
-#define HDlocaltime(T) localtime(T)
-#define HDlog(X) log(X)
-#define HDlog10(X) log10(X)
-#define HDlongjmp(J,N) longjmp(J,N)
-#ifdef _WIN32
- #ifdef __MWERKS__
- #define HDlseek(F,O,W) lseek(F,O,W)
- #else /*MSVS */
- #define HDlseek(F,O,W) _lseeki64(F,O,W)
- #endif
-#else
- #ifdef H5_HAVE_FSEEK64
- #define HDlseek(F,O,W) lseek64(F,O,W)
- #else
- #define HDlseek(F,O,W) lseek(F,O,W)
- #endif
-#endif
-#define HDmalloc(Z) malloc(Z)
-#define HDposix_memalign(P,A,Z) posix_memalign(P,A,Z)
-#define HDmblen(S,N) mblen(S,N)
-#define HDmbstowcs(P,S,Z) mbstowcs(P,S,Z)
-#define HDmbtowc(P,S,Z) mbtowc(P,S,Z)
-#define HDmemchr(S,C,Z) memchr(S,C,Z)
-#define HDmemcmp(X,Y,Z) memcmp(X,Y,Z)
+#endif /* HDlseek */
+#ifndef HDmalloc
+ #define HDmalloc(Z) malloc(Z)
+#endif /* HDmalloc */
+#ifndef HDposix_memalign
+ #define HDposix_memalign(P,A,Z) posix_memalign(P,A,Z)
+#endif /* HDposix_memalign */
+#ifndef HDmblen
+ #define HDmblen(S,N) mblen(S,N)
+#endif /* HDmblen */
+#ifndef HDmbstowcs
+ #define HDmbstowcs(P,S,Z) mbstowcs(P,S,Z)
+#endif /* HDmbstowcs */
+#ifndef HDmbtowc
+ #define HDmbtowc(P,S,Z) mbtowc(P,S,Z)
+#endif /* HDmbtowc */
+#ifndef HDmemchr
+ #define HDmemchr(S,C,Z) memchr(S,C,Z)
+#endif /* HDmemchr */
+#ifndef HDmemcmp
+ #define HDmemcmp(X,Y,Z) memcmp(X,Y,Z)
+#endif /* HDmemcmp */
/*
* The (char*) casts are required for the DEC when optimizations are turned
* on and the source and/or destination are not aligned.
*/
-#define HDmemcpy(X,Y,Z) memcpy((char*)(X),(const char*)(Y),Z)
-#define HDmemmove(X,Y,Z) memmove((char*)(X),(const char*)(Y),Z)
-/*
- * The (void*) cast just avoids a compiler warning in _WIN32
- */
-#ifdef _WIN32
-#define HDmemset(X,C,Z) memset((void*)(X),C,Z)
-#else /* _WIN32 */
-#define HDmemset(X,C,Z) memset(X,C,Z)
-#endif /* _WIN32 */
-#ifdef _WIN32
-#define HDmkdir(S,M) _mkdir(S)
-#else /* _WIN32 */
-#define HDmkdir(S,M) mkdir(S,M)
-#endif /* _WIN32 */
-#define HDmkfifo(S,M) mkfifo(S,M)
-#define HDmktime(T) mktime(T)
-#define HDmodf(X,Y) modf(X,Y)
-#ifdef _O_BINARY
-#define HDopen(S,F,M) open(S,F|_O_BINARY,M)
-#else
-#define HDopen(S,F,M) open(S,F,M)
-#endif
-#define HDopendir(S) opendir(S)
-#define HDpathconf(S,N) pathconf(S,N)
-#define HDpause() pause()
-#define HDperror(S) perror(S)
-#define HDpipe(F) pipe(F)
-#define HDpow(X,Y) pow(X,Y)
+#ifndef HDmemcpy
+ #define HDmemcpy(X,Y,Z) memcpy((char*)(X),(const char*)(Y),Z)
+#endif /* HDmemcpy */
+#ifndef HDmemmove
+ #define HDmemmove(X,Y,Z) memmove((char*)(X),(const char*)(Y),Z)
+#endif /* HDmemmove */
+#ifndef HDmemset
+ #define HDmemset(X,C,Z) memset(X,C,Z)
+#endif /* HDmemset */
+#ifndef HDmkdir
+ #define HDmkdir(S,M) mkdir(S,M)
+#endif /* HDmkdir */
+#ifndef HDmkfifo
+ #define HDmkfifo(S,M) mkfifo(S,M)
+#endif /* HDmkfifo */
+#ifndef HDmktime
+ #define HDmktime(T) mktime(T)
+#endif /* HDmktime */
+#ifndef HDmodf
+ #define HDmodf(X,Y) modf(X,Y)
+#endif /* HDmodf */
+#ifndef HDopen
+ #ifdef _O_BINARY
+ #define HDopen(S,F,M) open(S,F|_O_BINARY,M)
+ #else
+ #define HDopen(S,F,M) open(S,F,M)
+ #endif
+#endif /* HDopen */
+#ifndef HDopendir
+ #define HDopendir(S) opendir(S)
+#endif /* HDopendir */
+#ifndef HDpathconf
+ #define HDpathconf(S,N) pathconf(S,N)
+#endif /* HDpathconf */
+#ifndef HDpause
+ #define HDpause() pause()
+#endif /* HDpause */
+#ifndef HDperror
+ #define HDperror(S) perror(S)
+#endif /* HDperror */
+#ifndef HDpipe
+ #define HDpipe(F) pipe(F)
+#endif /* HDpipe */
+#ifndef HDpow
+ #define HDpow(X,Y) pow(X,Y)
+#endif /* HDpow */
/* printf() variable arguments */
-#define HDputc(C,F) putc(C,F)
-#define HDputchar(C) putchar(C)
-#define HDputs(S) puts(S)
-#define HDqsort(M,N,Z,F) qsort(M,N,Z,F)
-#define HDraise(N) raise(N)
+#ifndef HDputc
+ #define HDputc(C,F) putc(C,F)
+#endif /* HDputc*/
+#ifndef HDputchar
+ #define HDputchar(C) putchar(C)
+#endif /* HDputchar */
+#ifndef HDputs
+ #define HDputs(S) puts(S)
+#endif /* HDputs */
+#ifndef HDqsort
+ #define HDqsort(M,N,Z,F) qsort(M,N,Z,F)
+#endif /* HDqsort*/
+#ifndef HDraise
+ #define HDraise(N) raise(N)
+#endif /* HDraise */
#ifdef H5_HAVE_RAND_R
-#define HDrandom() HDrand()
-H5_DLL int HDrand(void);
+ #ifndef HDrandom
+ #define HDrandom() HDrand()
+ #endif /* HDrandom */
+ H5_DLL int HDrand(void);
#elif H5_HAVE_RANDOM
-#define HDrand() random()
-#define HDrandom() random()
-#else
-#define HDrand() rand()
-#define HDrandom() rand()
-#endif
-
-#define HDread(F,M,Z) read(F,M,Z)
-#define HDreaddir(D) readdir(D)
-#define HDrealloc(M,Z) realloc(M,Z)
+ #ifndef HDrand
+ #define HDrand() random()
+ #endif /* HDrand */
+ #ifndef HDrandom
+ #define HDrandom() random()
+ #endif /* HDrandom */
+#else /* H5_HAVE_RANDOM */
+ #ifndef HDrand
+ #define HDrand() rand()
+ #endif /* HDrand */
+ #ifndef HDrandom
+ #define HDrandom() rand()
+ #endif /* HDrandom */
+#endif /* H5_HAVE_RANDOM */
+
+#ifndef HDread
+ #define HDread(F,M,Z) read(F,M,Z)
+#endif /* HDread */
+#ifndef HDreaddir
+ #define HDreaddir(D) readdir(D)
+#endif /* HDreaddir */
+#ifndef HDrealloc
+ #define HDrealloc(M,Z) realloc(M,Z)
+#endif /* HDrealloc */
#ifdef H5_VMS
-#ifdef __cplusplus
-extern "C" {
-#endif
-int HDremove_all(const char * fname);
-#ifdef __cplusplus
-}
-#endif
-#define HDremove(S) HDremove_all(S)
-#else
-#define HDremove(S) remove(S)
+ #ifdef __cplusplus
+ extern "C" {
+ #endif /* __cplusplus */
+ int HDremove_all(const char * fname);
+ #ifdef __cplusplus
+ }
+ #endif /* __cplusplus */
+ #ifndef HDremove
+ #define HDremove(S) HDremove_all(S)
+ #endif /* HDremove */
+#else /* H5_VMS */
+ #ifndef HDremove
+ #define HDremove(S) remove(S)
+ #endif /* HDremove */
#endif /*H5_VMS*/
-#define HDrename(OLD,NEW) rename(OLD,NEW)
-#define HDrewind(F) rewind(F)
-#define HDrewinddir(D) rewinddir(D)
-#define HDrmdir(S) rmdir(S)
+#ifndef HDrename
+ #define HDrename(OLD,NEW) rename(OLD,NEW)
+#endif /* HDrename */
+#ifndef HDrewind
+ #define HDrewind(F) rewind(F)
+#endif /* HDrewind */
+#ifndef HDrewinddir
+ #define HDrewinddir(D) rewinddir(D)
+#endif /* HDrewinddir */
+#ifndef HDrmdir
+ #define HDrmdir(S) rmdir(S)
+#endif /* HDrmdir */
/* scanf() variable arguments */
-#define HDsetbuf(F,S) setbuf(F,S)
-#define HDsetgid(G) setgid(G)
-#define HDsetjmp(J) setjmp(J)
-#define HDsetlocale(N,S) setlocale(N,S)
-#define HDsetpgid(P,PG) setpgid(P,PG)
-#define HDsetsid() setsid()
-#define HDsetuid(U) setuid(U)
-/* Windows does not permit setting the buffer size to values
- less than 2. */
-#ifndef _WIN32
-#define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,Z)
-#else
-#define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,(Z>1?Z:2))
-#endif
-#define HDsigaction(N,A) sigaction(N,A)
-#define HDsigaddset(S,N) sigaddset(S,N)
-#define HDsigdelset(S,N) sigdelset(S,N)
-#define HDsigemptyset(S) sigemptyset(S)
-#define HDsigfillset(S) sigfillset(S)
-#define HDsigismember(S,N) sigismember(S,N)
-#define HDsiglongjmp(J,N) siglongjmp(J,N)
-#define HDsignal(N,F) signal(N,F)
-#define HDsigpending(S) sigpending(S)
-#define HDsigprocmask(H,S,O) sigprocmask(H,S,O)
-#define HDsigsetjmp(J,N) sigsetjmp(J,N)
-#define HDsigsuspend(S) sigsuspend(S)
-#define HDsin(X) sin(X)
-#define HDsinh(X) sinh(X)
-#define HDsleep(N) sleep(N)
-#ifdef _WIN32
-#define HDsnprintf _snprintf /*varargs*/
-#else
-#define HDsnprintf snprintf /*varargs*/
-#endif
+#ifndef HDsetbuf
+ #define HDsetbuf(F,S) setbuf(F,S)
+#endif /* HDsetbuf */
+#ifndef HDsetgid
+ #define HDsetgid(G) setgid(G)
+#endif /* HDsetgid */
+#ifndef HDsetjmp
+ #define HDsetjmp(J) setjmp(J)
+#endif /* HDsetjmp */
+#ifndef HDsetlocale
+ #define HDsetlocale(N,S) setlocale(N,S)
+#endif /* HDsetlocale */
+#ifndef HDsetpgid
+ #define HDsetpgid(P,PG) setpgid(P,PG)
+#endif /* HDsetpgid */
+#ifndef HDsetsid
+ #define HDsetsid() setsid()
+#endif /* HDsetsid */
+#ifndef HDsetuid
+ #define HDsetuid(U) setuid(U)
+#endif /* HDsetuid */
+#ifndef HDsetvbuf
+ #define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,Z)
+#endif /* HDsetvbuf */
+#ifndef HDsigaction
+ #define HDsigaction(N,A) sigaction(N,A)
+#endif /* HDsigaction */
+#ifndef HDsigaddset
+ #define HDsigaddset(S,N) sigaddset(S,N)
+#endif /* HDsigaddset */
+#ifndef HDsigdelset
+ #define HDsigdelset(S,N) sigdelset(S,N)
+#endif /* HDsigdelset */
+#ifndef HDsigemptyset
+ #define HDsigemptyset(S) sigemptyset(S)
+#endif /* HDsigemptyset */
+#ifndef HDsigfillset
+ #define HDsigfillset(S) sigfillset(S)
+#endif /* HDsigfillset */
+#ifndef HDsigismember
+ #define HDsigismember(S,N) sigismember(S,N)
+#endif /* HDsigismember */
+#ifndef HDsiglongjmp
+ #define HDsiglongjmp(J,N) siglongjmp(J,N)
+#endif /* HDsiglongjmp */
+#ifndef HDsignal
+ #define HDsignal(N,F) signal(N,F)
+#endif /* HDsignal */
+#ifndef HDsigpending
+ #define HDsigpending(S) sigpending(S)
+#endif /* HDsigpending */
+#ifndef HDsigprocmask
+ #define HDsigprocmask(H,S,O) sigprocmask(H,S,O)
+#endif /* HDsigprocmask */
+#ifndef HDsigsetjmp
+ #define HDsigsetjmp(J,N) sigsetjmp(J,N)
+#endif /* HDsigsetjmp */
+#ifndef HDsigsuspend
+ #define HDsigsuspend(S) sigsuspend(S)
+#endif /* HDsigsuspend */
+#ifndef HDsin
+ #define HDsin(X) sin(X)
+#endif /* HDsin */
+#ifndef HDsinh
+ #define HDsinh(X) sinh(X)
+#endif /* HDsinh */
+#ifndef HDsleep
+ #define HDsleep(N) sleep(N)
+#endif /* HDsleep */
+#ifndef HDsnprintf
+ #define HDsnprintf snprintf /*varargs*/
+#endif /* HDsnprintf */
/* sprintf() variable arguments */
-#define HDsqrt(X) sqrt(X)
+#ifndef HDsqrt
+ #define HDsqrt(X) sqrt(X)
+#endif /* HDsqrt */
#ifdef H5_HAVE_RAND_R
-H5_DLL void HDsrand(unsigned int seed);
-#define HDsrandom(S) HDsrand(S)
-#elif H5_HAVE_RANDOM
-#define HDsrand(S) srandom(S)
-#define HDsrandom(S) srandom(S)
-#else
-#define HDsrand(S) srand(S)
-#define HDsrandom(S) srand(S)
-#endif
+ H5_DLL void HDsrand(unsigned int seed);
+ #ifndef HDsrandom
+ #define HDsrandom(S) HDsrand(S)
+ #endif /* HDsrandom */
+ #elif H5_HAVE_RANDOM
+ #ifndef HDsrand
+ #define HDsrand(S) srandom(S)
+ #endif /* HDsrand */
+ #ifndef HDsrandom
+ #define HDsrandom(S) srandom(S)
+ #endif /* HDsrandom */
+#else /* H5_HAVE_RAND_R */
+ #ifndef HDsrand
+ #define HDsrand(S) srand(S)
+ #endif /* HDsrand */
+ #ifndef HDsrandom
+ #define HDsrandom(S) srand(S)
+ #endif /* HDsrandom */
+#endif /* H5_HAVE_RAND_R */
/* sscanf() variable arguments */
-#define HDstrcat(X,Y) strcat(X,Y)
-#define HDstrchr(S,C) strchr(S,C)
-#define HDstrcmp(X,Y) strcmp(X,Y)
-#define HDstrcoll(X,Y) strcoll(X,Y)
-#define HDstrcpy(X,Y) strcpy(X,Y)
-#define HDstrcspn(X,Y) strcspn(X,Y)
-#define HDstrerror(N) strerror(N)
-#define HDstrftime(S,Z,F,T) strftime(S,Z,F,T)
-#define HDstrlen(S) strlen(S)
-#define HDstrncat(X,Y,Z) strncat(X,Y,Z)
-#define HDstrncmp(X,Y,Z) strncmp(X,Y,Z)
-#define HDstrncpy(X,Y,Z) strncpy(X,Y,Z)
-#define HDstrpbrk(X,Y) strpbrk(X,Y)
-#define HDstrrchr(S,C) strrchr(S,C)
-#define HDstrspn(X,Y) strspn(X,Y)
-#define HDstrstr(X,Y) strstr(X,Y)
-#define HDstrtod(S,R) strtod(S,R)
-#define HDstrtok(X,Y) strtok(X,Y)
-#define HDstrtol(S,R,N) strtol(S,R,N)
+#ifndef HDstrcat
+ #define HDstrcat(X,Y) strcat(X,Y)
+#endif /* HDstrcat */
+#ifndef HDstrchr
+ #define HDstrchr(S,C) strchr(S,C)
+#endif /* HDstrchr */
+#ifndef HDstrcmp
+ #define HDstrcmp(X,Y) strcmp(X,Y)
+#endif /* HDstrcmp */
+#ifndef HDstrcoll
+ #define HDstrcoll(X,Y) strcoll(X,Y)
+#endif /* HDstrcoll */
+#ifndef HDstrcpy
+ #define HDstrcpy(X,Y) strcpy(X,Y)
+#endif /* HDstrcpy */
+#ifndef HDstrcspn
+ #define HDstrcspn(X,Y) strcspn(X,Y)
+#endif /* HDstrcspn */
+#ifndef HDstrerror
+ #define HDstrerror(N) strerror(N)
+#endif /* HDstrerror */
+#ifndef HDstrftime
+ #define HDstrftime(S,Z,F,T) strftime(S,Z,F,T)
+#endif /* HDstrftime */
+#ifndef HDstrlen
+ #define HDstrlen(S) strlen(S)
+#endif /* HDstrlen */
+#ifndef HDstrncat
+ #define HDstrncat(X,Y,Z) strncat(X,Y,Z)
+#endif /* HDstrncat */
+#ifndef HDstrncmp
+ #define HDstrncmp(X,Y,Z) strncmp(X,Y,Z)
+#endif /* HDstrncmp */
+#ifndef HDstrncpy
+ #define HDstrncpy(X,Y,Z) strncpy(X,Y,Z)
+#endif /* HDstrncpy */
+#ifndef HDstrpbrk
+ #define HDstrpbrk(X,Y) strpbrk(X,Y)
+#endif /* HDstrpbrk */
+#ifndef HDstrrchr
+ #define HDstrrchr(S,C) strrchr(S,C)
+#endif /* HDstrrchr */
+#ifndef HDstrspn
+ #define HDstrspn(X,Y) strspn(X,Y)
+#endif /* HDstrspn */
+#ifndef HDstrstr
+ #define HDstrstr(X,Y) strstr(X,Y)
+#endif /* HDstrstr */
+#ifndef HDstrtod
+ #define HDstrtod(S,R) strtod(S,R)
+#endif /* HDstrtod */
+#ifndef HDstrtok
+ #define HDstrtok(X,Y) strtok(X,Y)
+#endif /* HDstrtok */
+#ifndef HDstrtol
+ #define HDstrtol(S,R,N) strtol(S,R,N)
+#endif /* HDstrtol */
H5_DLL int64_t HDstrtoll (const char *s, const char **rest, int base);
-#define HDstrtoul(S,R,N) strtoul(S,R,N)
-#define HDstrxfrm(X,Y,Z) strxfrm(X,Y,Z)
-#define HDsysconf(N) sysconf(N)
-#define HDsystem(S) system(S)
-#define HDtan(X) tan(X)
-#define HDtanh(X) tanh(X)
-#define HDtcdrain(F) tcdrain(F)
-#define HDtcflow(F,A) tcflow(F,A)
-#define HDtcflush(F,N) tcflush(F,N)
-#define HDtcgetattr(F,T) tcgetattr(F,T)
-#define HDtcgetpgrp(F) tcgetpgrp(F)
-#define HDtcsendbreak(F,N) tcsendbreak(F,N)
-#define HDtcsetattr(F,O,T) tcsetattr(F,O,T)
-#define HDtcsetpgrp(F,N) tcsetpgrp(F,N)
-#define HDtime(T) time(T)
-#define HDtimes(T) times(T)
-#define HDtmpfile() tmpfile()
-#define HDtmpnam(S) tmpnam(S)
-#define HDtolower(C) tolower(C)
-#define HDtoupper(C) toupper(C)
-#define HDttyname(F) ttyname(F)
-#define HDtzset() tzset()
-#define HDumask(N) umask(N)
-#define HDuname(S) uname(S)
-#define HDungetc(C,F) ungetc(C,F)
-#ifdef _WIN32
-#define HDunlink(S) _unlink(S)
-#else
-#define HDunlink(S) unlink(S)
-#endif
-#define HDutime(S,T) utime(S,T)
-#define HDva_arg(A,T) va_arg(A,T)
-#define HDva_end(A) va_end(A)
-#define HDva_start(A,P) va_start(A,P)
-#define HDvasprintf(RET,FMT,A) vasprintf(RET,FMT,A)
-#define HDvfprintf(F,FMT,A) vfprintf(F,FMT,A)
-#define HDvprintf(FMT,A) vprintf(FMT,A)
-#define HDvsprintf(S,FMT,A) vsprintf(S,FMT,A)
-#ifdef _WIN32
-# define HDvsnprintf(S,N,FMT,A) _vsnprintf(S,N,FMT,A)
-#else
-# define HDvsnprintf(S,N,FMT,A) vsnprintf(S,N,FMT,A)
-#endif
-#define HDwait(W) wait(W)
-#define HDwaitpid(P,W,O) waitpid(P,W,O)
-#define HDwcstombs(S,P,Z) wcstombs(S,P,Z)
-#define HDwctomb(S,C) wctomb(S,C)
-
-#if defined (__MWERKS__)
-/* workaround for a bug in the Metrowerks version 6.0 header file for write
- which is not defined as const void*
- */
-#define HDwrite(F,M,Z) write(F,(void*)M,Z)
-#else
-#define HDwrite(F,M,Z) write(F,M,Z)
-#endif
+#ifndef HDstrtoul
+ #define HDstrtoul(S,R,N) strtoul(S,R,N)
+#endif /* HDstrtoul */
+#ifndef HDstrxfrm
+ #define HDstrxfrm(X,Y,Z) strxfrm(X,Y,Z)
+#endif /* HDstrxfrm */
+#ifndef HDsysconf
+ #define HDsysconf(N) sysconf(N)
+#endif /* HDsysconf */
+#ifndef HDsystem
+ #define HDsystem(S) system(S)
+#endif /* HDsystem */
+#ifndef HDtan
+ #define HDtan(X) tan(X)
+#endif /* HDtan */
+#ifndef HDtanh
+ #define HDtanh(X) tanh(X)
+#endif /* HDtanh */
+#ifndef HDtcdrain
+ #define HDtcdrain(F) tcdrain(F)
+#endif /* HDtcdrain */
+#ifndef HDtcflow
+ #define HDtcflow(F,A) tcflow(F,A)
+#endif /* HDtcflow */
+#ifndef HDtcflush
+ #define HDtcflush(F,N) tcflush(F,N)
+#endif /* HDtcflush */
+#ifndef HDtcgetattr
+ #define HDtcgetattr(F,T) tcgetattr(F,T)
+#endif /* HDtcgetattr */
+#ifndef HDtcgetpgrp
+ #define HDtcgetpgrp(F) tcgetpgrp(F)
+#endif /* HDtcgetpgrp */
+#ifndef HDtcsendbreak
+ #define HDtcsendbreak(F,N) tcsendbreak(F,N)
+#endif /* HDtcsendbreak */
+#ifndef HDtcsetattr
+ #define HDtcsetattr(F,O,T) tcsetattr(F,O,T)
+#endif /* HDtcsetattr */
+#ifndef HDtcsetpgrp
+ #define HDtcsetpgrp(F,N) tcsetpgrp(F,N)
+#endif /* HDtcsetpgrp */
+#ifndef HDtime
+ #define HDtime(T) time(T)
+#endif /* HDtime */
+#ifndef HDtimes
+ #define HDtimes(T) times(T)
+#endif /* HDtimes*/
+#ifndef HDtmpfile
+ #define HDtmpfile() tmpfile()
+#endif /* HDtmpfile */
+#ifndef HDtmpnam
+ #define HDtmpnam(S) tmpnam(S)
+#endif /* HDtmpnam */
+#ifndef HDtolower
+ #define HDtolower(C) tolower(C)
+#endif /* HDtolower */
+#ifndef HDtoupper
+ #define HDtoupper(C) toupper(C)
+#endif /* HDtoupper */
+#ifndef HDttyname
+ #define HDttyname(F) ttyname(F)
+#endif /* HDttyname */
+#ifndef HDtzset
+ #define HDtzset() tzset()
+#endif /* HDtzset */
+#ifndef HDumask
+ #define HDumask(N) umask(N)
+#endif /* HDumask */
+#ifndef HDuname
+ #define HDuname(S) uname(S)
+#endif /* HDuname */
+#ifndef HDungetc
+ #define HDungetc(C,F) ungetc(C,F)
+#endif /* HDungetc */
+#ifndef HDunlink
+ #define HDunlink(S) unlink(S)
+#endif /* HDunlink */
+#ifndef HDutime
+ #define HDutime(S,T) utime(S,T)
+#endif /* HDutime */
+#ifndef HDva_arg
+ #define HDva_arg(A,T) va_arg(A,T)
+#endif /* HDva_arg */
+#ifndef HDva_end
+ #define HDva_end(A) va_end(A)
+#endif /* HDva_end */
+#ifndef HDva_start
+ #define HDva_start(A,P) va_start(A,P)
+#endif /* HDva_start */
+#ifndef HDvasprintf
+ #define HDvasprintf(RET,FMT,A) vasprintf(RET,FMT,A)
+#endif /* HDvasprintf */
+#ifndef HDvfprintf
+ #define HDvfprintf(F,FMT,A) vfprintf(F,FMT,A)
+#endif /* HDvfprintf */
+#ifndef HDvprintf
+ #define HDvprintf(FMT,A) vprintf(FMT,A)
+#endif /* HDvprintf */
+#ifndef HDvsprintf
+ #define HDvsprintf(S,FMT,A) vsprintf(S,FMT,A)
+#endif /* HDvsprintf */
+#ifndef HDvsnprintf
+ #define HDvsnprintf(S,N,FMT,A) vsnprintf(S,N,FMT,A)
+#endif /* HDvsnprintf */
+#ifndef HDwait
+ #define HDwait(W) wait(W)
+#endif /* HDwait */
+#ifndef HDwaitpid
+ #define HDwaitpid(P,W,O) waitpid(P,W,O)
+#endif /* HDwaitpid */
+#ifndef HDwcstombs
+ #define HDwcstombs(S,P,Z) wcstombs(S,P,Z)
+#endif /* HDwcstombs */
+#ifndef HDwctomb
+ #define HDwctomb(S,C) wctomb(S,C)
+#endif /* HDwctomb */
+#ifndef HDwrite
+ #define HDwrite(F,M,Z) write(F,M,Z)
+#endif /* HDwrite */
/*
* And now for a couple non-Posix functions... Watch out for systems that
* define these in terms of macros.
*/
-#ifdef _WIN32
-#define HDstrdup(S) _strdup(S)
-#else /* _WIN32 */
-
#if !defined strdup && !defined H5_HAVE_STRDUP
extern char *strdup(const char *s);
#endif
-#define HDstrdup(S) strdup(S)
+#ifndef HDstrdup
+ #define HDstrdup(S) strdup(S)
+#endif /* HDstrdup */
-#endif /* _WIN32 */
#ifdef H5_HAVE_WINDOW_PATH
diff --git a/src/win32defs.h b/src/win32defs.h
new file mode 100644
index 0000000..484b73d
--- /dev/null
+++ b/src/win32defs.h
@@ -0,0 +1,56 @@
+/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
+ * Copyright by The HDF Group. *
+ * Copyright by the Board of Trustees of the University of Illinois. *
+ * All rights reserved. *
+ * *
+ * This file is part of HDF5. The full HDF5 copyright notice, including *
+ * terms governing use, modification, and redistribution, is contained in *
+ * the files COPYING and Copyright.html. COPYING can be found at the root *
+ * of the source code distribution tree; Copyright.html can be found at the *
+ * root level of an installed copy of the electronic HDF5 document set and *
+ * is linked from the top-level documents page. It can also be found at *
+ * http://hdfgroup.org/HDF5/doc/Copyright.html. If you do not have *
+ * access to either file, you may request a copy from help@hdfgroup.org. *
+ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */
+
+/* Programmer: Scott Wegner
+ * June 3, 2008
+ *
+ * Purpose: This file is used to map HDF macros to Windows functions. This
+ * should get included H5private mappings, so as to override them.
+ * Any macro not mapped here, however, will receive a similar mapping
+ * inside H5private.h
+ *
+ */
+
+#ifdef _WIN32
+
+typedef struct _stati64 h5_stat_t;
+typedef __int64 h5_stat_size_t;
+
+#define HDaccess(F,M) _access(F,M)
+#define HDclose(F) _close(F)
+#define HDdup(F) _dup(F)
+#define HDfdopen(N,S) _fdopen(N,S)
+#define HDfileno(F) _fileno(F)
+#define HDfstat(F,B) _fstati64(F,B)
+#define HDisatty(F) _isatty(F)
+#define HDstat(S,B) _stati64(S,B)
+#define HDgetcwd(S,Z) _getcwd(S,Z)
+#define HDgetdcwd(D,S,Z) _getdcwd(D,S,Z)
+#define HDgetdrive() _getdrive()
+#define HDlseek(F,O,W) _lseeki64(F,O,W)
+#define HDmemset(X,C,Z) memset((void*)(X),C,Z)
+#define HDmkdir(S,M) _mkdir(S)
+#define HDopen(S,F,M) _open(S,F|_O_BINARY,M)
+#define HDread(F,M,Z) _read(F,M,Z)
+#define HDsetvbuf(F,S,M,Z) setvbuf(F,S,M,(Z>1?Z:2))
+#define HDstrdup(S) _strdup(S)
+#define HDsnprintf _snprintf /*varargs*/
+#define HDtzset() _tzset()
+#define HDunlink(S) _unlink(S)
+#define HDvsnprintf(S,N,FMT,A) _vsnprintf(S,N,FMT,A)
+#define HDwrite(F,M,Z) _write(F,M,Z)
+
+
+#endif /* _WIN32 */
diff --git a/test/dtypes.c b/test/dtypes.c
index 6707d2e..3dc5338 100644
--- a/test/dtypes.c
+++ b/test/dtypes.c
@@ -1731,11 +1731,11 @@ test_compound_10(void)
for(i=0; i<ARRAY_DIM; i++) {
wdata[i].i1 = i*10+i;
- wdata[i].str = strdup("C string A");
+ wdata[i].str = HDstrdup("C string A");
wdata[i].str[9] += i;
wdata[i].i2 = i*1000+i*10;
- wdata[i].text.p = (void*)strdup("variable-length text A\0");
+ wdata[i].text.p = (void*)HDstrdup("variable-length text A\0");
len = wdata[i].text.len = strlen((char*)wdata[i].text.p)+1;
((char*)(wdata[i].text.p))[len-2] += i;
((char*)(wdata[i].text.p))[len-1] = '\0';
diff --git a/test/external.c b/test/external.c
index d05889e..6820543 100644
--- a/test/external.c
+++ b/test/external.c
@@ -56,26 +56,26 @@ same_contents (const char *name1, const char *name2)
ssize_t n1, n2;
char buf1[1024], buf2[1024];
- fd1 = open (name1, O_RDONLY);
- fd2 = open (name2, O_RDONLY);
+ fd1 = HDopen(name1, O_RDONLY, 0666);
+ fd2 = HDopen(name2, O_RDONLY, 0666);
assert (fd1>=0 && fd2>=0);
while (1) {
- n1 = read (fd1, buf1, sizeof(buf1));
- n2 = read (fd2, buf2, sizeof(buf2));
+ n1 = HDread(fd1, buf1, sizeof(buf1));
+ n2 = HDread(fd2, buf2, sizeof(buf2));
assert (n1>=0 && (size_t)n1<=sizeof(buf1));
assert (n2>=0 && (size_t)n2<=sizeof(buf2));
assert (n1==n2);
if (n1<=0 && n2<=0) break;
if (memcmp (buf1, buf2, (size_t)n1)) {
- close (fd1);
- close (fd2);
+ HDclose(fd1);
+ HDclose(fd2);
return 0;
}
}
- close (fd1);
- close (fd2);
+ HDclose(fd1);
+ HDclose(fd2);
return 1;
}
@@ -619,15 +619,15 @@ test_2 (hid_t fapl)
part[j] = (int)(i*25+j);
}
sprintf (filename, "extern_%lua.raw", (unsigned long)i+1);
- fd = HDopen (filename, O_RDWR|O_CREAT|O_TRUNC, 0666);
+ fd = HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, 0666);
assert (fd>=0);
/* n = lseek (fd, (off_t)(i*10), SEEK_SET);
*/
- n = write(fd,temparray,(size_t)i*10);
+ n = HDwrite(fd,temparray,(size_t)i*10);
assert (n>=0 && (size_t)n==i*10);
- n = write (fd, part, sizeof(part));
+ n = HDwrite(fd, part, sizeof(part));
assert (n==sizeof(part));
- close (fd);
+ HDclose(fd);
}
/*
@@ -752,14 +752,14 @@ test_3 (hid_t fapl)
/* Make sure the output files are fresh*/
for (i=1; i<=4; i++) {
sprintf(filename, "extern_%db.raw", i);
- if ((fd= open(filename, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0) {
+ if ((fd= HDopen(filename, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0) {
H5_FAILED();
printf(" cannot open %s: %s\n", filename, strerror(errno));
goto error;
}
- write(fd, temparray, (i-1)*10);
- close (fd);
+ HDwrite(fd, temparray, (i-1)*10);
+ HDclose(fd);
}
/* Create the dataset */
diff --git a/test/fillval.c b/test/fillval.c
index 2cf1191..29f37b4 100644
--- a/test/fillval.c
+++ b/test/fillval.c
@@ -1883,8 +1883,8 @@ test_extend(hid_t fapl, const char *base_name, H5D_layout_t layout)
hsize_t nelmts;
nelmts = max_size[0]*max_size[1]*max_size[2]*max_size[3]*max_size[4];
- if((fd=open(FILE_NAME_RAW, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0 ||
- close(fd) < 0) goto error;
+ if((fd=HDopen(FILE_NAME_RAW, O_RDWR|O_CREAT|O_TRUNC, 0666)) < 0 ||
+ HDclose(fd) < 0) goto error;
if(H5Pset_external(dcpl, FILE_NAME_RAW, (off_t)0, (hsize_t)nelmts*sizeof(int)) < 0)
goto error;
}
diff --git a/test/hyperslab.c b/test/hyperslab.c
index ab3ffab..89dbc5c 100644
--- a/test/hyperslab.c
+++ b/test/hyperslab.c
@@ -258,7 +258,7 @@ test_fill(size_t nx, size_t ny, size_t nz,
if (acc != ref_value) {
puts("*FAILED*");
- if (!isatty(1)) {
+ if (!HDisatty(1)) {
/*
* Print debugging info unless output
* is going directly to a terminal.
@@ -504,7 +504,7 @@ test_copy(int mode,
}
if (acc != ref_value) {
puts("*FAILED*");
- if (!isatty(1)) {
+ if (!HDisatty(1)) {
/*
* Print debugging info unless output is
* going directly to a terminal.
@@ -547,7 +547,7 @@ test_copy(int mode,
if (acc+(unsigned)dx*(unsigned)dy*(unsigned)dz !=
ref_value + nx*ny*nz) {
puts("*FAILED*");
- if (!isatty(1)) {
+ if (!HDisatty(1)) {
/*
* Print debugging info unless output is
* going directly to a terminal.
@@ -675,7 +675,7 @@ test_multifill(size_t nx)
}
if (s[0]) {
puts("*FAILED*");
- if (!isatty(1)) {
+ if (!HDisatty(1)) {
AT();
printf(" fill={%d,%g,%d}\n ",
fill.left, fill.mid, fill.right);
@@ -757,7 +757,7 @@ test_endian(size_t nx)
for (j = 0; j < 4; j++) {
if (src[i * 4 + j] != dst[i * 4 + 3 - j]) {
puts("*FAILED*");
- if (!isatty(1)) {
+ if (!HDisatty(1)) {
/*
* Print debugging info unless output is going directly
* to a terminal.
@@ -851,7 +851,7 @@ test_transpose(size_t nx, size_t ny)
for (j = 0; j < ny; j++) {
if (src[i * ny + j] != dst[j * nx + i]) {
puts("*FAILED*");
- if (!isatty(1)) {
+ if (!HDisatty(1)) {
AT();
printf(" diff at i=%lu, j=%lu\n",
(unsigned long)i, (unsigned long)j);
@@ -948,7 +948,7 @@ test_sub_super(size_t nx, size_t ny)
for (j = 0; j < ny; j++) {
if (full[4 * i * ny + 2 * j] != half[i * ny + j]) {
puts("*FAILED*");
- if (!isatty(1)) {
+ if (!HDisatty(1)) {
AT();
printf(" full[%lu][%lu] != half[%lu][%lu]\n",
(unsigned long)i*2,
@@ -1025,7 +1025,7 @@ test_sub_super(size_t nx, size_t ny)
}
if (s[0]) {
puts("*FAILED*");
- if (!isatty(1)) {
+ if (!HDisatty(1)) {
AT();
printf(" %s\n Half is:\n", s);
print_array(half, nx, ny, (size_t)1);
@@ -1409,7 +1409,7 @@ main(int argc, char *argv[])
if (nerrors) {
printf("***** %d HYPERSLAB TEST%s FAILED! *****\n",
nerrors, 1 == nerrors ? "" : "S");
- if (isatty(1)) {
+ if (HDisatty(1)) {
printf("(Redirect output to a pager or a file to see "
"debug output)\n");
}
diff --git a/tools/h5dump/h5dump.c b/tools/h5dump/h5dump.c
index dffa251..aa44cc1 100644
--- a/tools/h5dump/h5dump.c
+++ b/tools/h5dump/h5dump.c
@@ -4184,7 +4184,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. */
diff --git a/windows/proj/property_sheets/remove-posix-warnings.vsprops b/windows/proj/property_sheets/remove-posix-warnings.vsprops
index 9b5a64f..68a9f3e 100644
--- a/windows/proj/property_sheets/remove-posix-warnings.vsprops
+++ b/windows/proj/property_sheets/remove-posix-warnings.vsprops
@@ -6,6 +6,6 @@
>
<Tool
Name="VCCLCompilerTool"
- PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS;_CRT_NONSTDC_NO_DEPRECATE;_CRT_SECURE_NO_DEPRECATE"
+ PreprocessorDefinitions="_CRT_SECURE_NO_WARNINGS"
/>
</VisualStudioPropertySheet>