summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDana Robinson <43805+derobins@users.noreply.github.com>2022-06-22 18:21:51 (GMT)
committerGitHub <noreply@github.com>2022-06-22 18:21:51 (GMT)
commitd6f05069c1a3642bbebf7ec27e7df809f0675f13 (patch)
tree37992bf8e04623b36bbd5e7bc24a2cdec6a1f50d /src
parent8bfed8aae444f23b493f641ea45b257b2498d79c (diff)
downloadhdf5-d6f05069c1a3642bbebf7ec27e7df809f0675f13.zip
hdf5-d6f05069c1a3642bbebf7ec27e7df809f0675f13.tar.gz
hdf5-d6f05069c1a3642bbebf7ec27e7df809f0675f13.tar.bz2
Adds notes about off_t sizes on Windows (#1817)
Diffstat (limited to 'src')
-rw-r--r--src/H5win32defs.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/H5win32defs.h b/src/H5win32defs.h
index 44cf50c..d3ad098 100644
--- a/src/H5win32defs.h
+++ b/src/H5win32defs.h
@@ -26,6 +26,9 @@
*/
#ifdef H5_HAVE_WIN32_API
+/* __int64 is the correct type for the st_size field of the _stati64 struct.
+ * MSDN isn't very clear about this.
+ */
typedef struct _stati64 h5_stat_t;
typedef __int64 h5_stat_size_t;
@@ -57,7 +60,12 @@ struct timezone {
#define HDlstat(S, B) _lstati64(S, B)
#define HDmemset(X, C, Z) memset((void *)(X), C, Z) /* Cast avoids MSVC warning */
#define HDmkdir(S, M) _mkdir(S)
-#define HDoff_t __int64
+
+/* off_t exists on Windows, but is always a 32-bit long, even on 64-bit Windows,
+ * so we define HDoff_t to be __int64, which is the type of the st_size field
+ * of the _stati64 struct.
+ */
+#define HDoff_t __int64
/* Note that the variadic HDopen macro is using a VC++ extension
* where the comma is dropped if nothing is passed to the ellipsis.