summaryrefslogtreecommitdiffstats
path: root/src/H5FDsec2.c
diff options
context:
space:
mode:
authorQuincey Koziol <koziol@hdfgroup.org>2001-06-29 19:49:53 (GMT)
committerQuincey Koziol <koziol@hdfgroup.org>2001-06-29 19:49:53 (GMT)
commit8c2c4cd51cb8dd1393acad65e3f015d76bfd9563 (patch)
treea663d3ab5cc66e53485a66d973b55dbb571640be /src/H5FDsec2.c
parent098ed81ec88483581d08974f27a62bf42a836fc3 (diff)
downloadhdf5-8c2c4cd51cb8dd1393acad65e3f015d76bfd9563.zip
hdf5-8c2c4cd51cb8dd1393acad65e3f015d76bfd9563.tar.gz
hdf5-8c2c4cd51cb8dd1393acad65e3f015d76bfd9563.tar.bz2
[svn-r4088] Purpose:
Code cleanup Description: Recent CodeWarrior patches have broken the Unix builds and moved code around in non-portable ways. Solution: Patched things back up to try to accomodate CodeWarrior and still let the Unix builds work correctly. Platforms tested: FreeBSD 4.3 (hawkwind)
Diffstat (limited to 'src/H5FDsec2.c')
-rw-r--r--src/H5FDsec2.c31
1 files changed, 30 insertions, 1 deletions
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index 6e77bf5..14481f3 100644
--- a/src/H5FDsec2.c
+++ b/src/H5FDsec2.c
@@ -76,6 +76,35 @@ typedef struct H5FD_sec2_t {
} H5FD_sec2_t;
+/*
+ * This driver supports systems that have the lseek64() function by defining
+ * some macros here so we don't have to have conditional compilations later
+ * throughout the code.
+ *
+ * file_offset_t: The datatype for file offsets, the second argument of
+ * the lseek() or lseek64() call.
+ *
+ * file_seek: The function which adjusts the current file position,
+ * either lseek() or lseek64().
+ */
+/* adding for windows NT file system support. */
+/* pvn: added __MWERKS__ support. */
+
+#ifdef H5_HAVE_LSEEK64
+# define file_offset_t off64_t
+# define file_seek lseek64
+#elif defined (WIN32)
+# ifdef __MWERKS__
+# define file_offset_t off_t
+# define file_seek lseek
+# else /*MSVC*/
+# define file_offset_t __int64
+# define file_seek _lseeki64
+# endif
+#else
+# define file_offset_t off_t
+# define file_seek lseek
+#endif
/*
* These macros check for overflow of various quantities. These macros
@@ -636,7 +665,7 @@ H5FD_sec2_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, had
while (size>0) {
do {
assert(size==(hsize_t)((size_t)size)); /*check for overflow*/
- nbytes = HDwrite(file->fd, (void*)buf, (size_t)size);
+ nbytes = HDwrite(file->fd, buf, (size_t)size);
} while (-1==nbytes && EINTR==errno);
if (-1==nbytes) {
/* error */