summaryrefslogtreecommitdiffstats
path: root/src/H5win32defs.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/H5win32defs.h')
-rw-r--r--src/H5win32defs.h55
1 files changed, 28 insertions, 27 deletions
diff --git a/src/H5win32defs.h b/src/H5win32defs.h
index 743ceaa..5daef23 100644
--- a/src/H5win32defs.h
+++ b/src/H5win32defs.h
@@ -23,7 +23,7 @@
*
*/
-#ifdef _WIN32
+#ifdef H5_HAVE_WIN32_API
typedef struct _stati64 h5_stat_t;
typedef __int64 h5_stat_size_t;
@@ -33,17 +33,35 @@ typedef __int64 h5_stat_size_t;
#define HDdup(F) _dup(F)
#define HDfdopen(N,S) _fdopen(N,S)
#define HDfileno(F) _fileno(F)
-#if _MSC_VER > 1310 /* Newer than VS.NET 2003 */
#define HDftruncate(F,L) _chsize_s(F,L)
-#else
-#define HDftruncate(F,L) chsize(F,L)
-#endif
#define HDfstat(F,B) _fstati64(F,B)
#define HDisatty(F) _isatty(F)
-#define HDlstat(S,B) _lstati64(S,B)
-#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 HDlstat(S,B) _lstati64(S,B)
+#define HDmkdir(S,M) _mkdir(S)
+#define HDoff_t __int64
+#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 HDsleep(S) Sleep(S*1000)
+#define HDstat(S,B) _stati64(S,B)
+#define HDstrcasecmp(A,B) _stricmp(A,B)
+#define HDstrtoull(S,R,N) _strtoui64(S,R,N)
+#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)
+
+#ifdef H5_HAVE_VISUAL_STUDIO
+/*
+ * The (void*) cast just avoids a compiler warning in H5_HAVE_VISUAL_STUDIO
+ */
+#define HDmemset(X,C,Z) memset((void*)(X),C,Z)
struct timezone {
int tz_minuteswest;
@@ -60,24 +78,8 @@ struct timezone {
#endif /* __cplusplus */
#define HDgettimeofday(V,Z) Wgettimeofday(V,Z)
#define HDgetlogin() Wgetlogin()
-
-#define HDgetdrive() _getdrive()
-#define HDlseek(F,O,W) _lseeki64(F,O,W)
-#define HDoff_t __int64
-#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 HDsleep(S) Sleep(S*1000)
-#define HDstrcasecmp(A,B) _stricmp(A,B)
-#define HDstrtoull(S,R,N) _strtoui64(S,R,N)
-#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 /* H5_HAVE_VISUAL_STUDIO */
/* Non-POSIX functions */
@@ -85,5 +87,4 @@ struct timezone {
* type cannot be cast as a ulong like other systems. */
#define HDpthread_self_ulong() ((unsigned long)GetCurrentThreadId())
-
-#endif /* _WIN32 */
+#endif /* H5_HAVE_WIN32_API */