summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/H5.c2
-rw-r--r--src/H5FDdpss.c21
-rw-r--r--src/H5FDgass.c19
-rw-r--r--src/H5FDlog.c23
-rw-r--r--src/H5FDsec2.c26
-rw-r--r--src/H5FDsrb.c8
-rw-r--r--src/H5FDstdio.c6
-rw-r--r--src/H5Oefl.c2
-rw-r--r--src/H5Omtime.c4
-rw-r--r--src/H5Ppublic.h1
-rw-r--r--src/H5Vprivate.h12
-rw-r--r--src/H5private.h97
12 files changed, 110 insertions, 111 deletions
diff --git a/src/H5.c b/src/H5.c
index 549c62e..5b33830 100644
--- a/src/H5.c
+++ b/src/H5.c
@@ -36,7 +36,9 @@
#endif
/* We need this on Irix64 even though we've included stdio.h as documented */
+#if !defined __MWERKS__
FILE *fdopen(int fd, const char *mode);
+#endif
#define PABLO_MASK H5_mask
diff --git a/src/H5FDdpss.c b/src/H5FDdpss.c
index cc378d1..3fde293 100644
--- a/src/H5FDdpss.c
+++ b/src/H5FDdpss.c
@@ -51,26 +51,7 @@ typedef struct H5FD_dpss_t {
haddr_t eof; /* end of file; current file size */
} H5FD_dpss_t;
-
-/*** FIXME: is this really needed here ? ***/
-/*
- * 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().
- */
-#ifdef H5_HAVE_LSEEK64
-# define file_offset_t off64_t
-# define file_seek lseek64
-#else
-# define file_offset_t off_t
-# define file_seek lseek
-#endif
+
/*
* These macros check for overflow of various quantities. These macros
diff --git a/src/H5FDgass.c b/src/H5FDgass.c
index 9151440..2394329 100644
--- a/src/H5FDgass.c
+++ b/src/H5FDgass.c
@@ -54,24 +54,7 @@ typedef struct H5FD_gass_t {
} H5FD_gass_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().
- */
-#ifdef H5_HAVE_LSEEK64
-# define file_offset_t off64_t
-# define file_seek lseek64
-#else
-# define file_offset_t off_t
-# define file_seek lseek
-#endif
+
/*
* These macros check for overflow of various quantities. These macros
diff --git a/src/H5FDlog.c b/src/H5FDlog.c
index ac04c2b..4f64f09 100644
--- a/src/H5FDlog.c
+++ b/src/H5FDlog.c
@@ -104,24 +104,7 @@ typedef struct H5FD_log_t {
#endif
} H5FD_log_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().
- */
-#ifdef H5_HAVE_LSEEK64
-# define file_offset_t off64_t
-# define file_seek lseek64
-#else
-# define file_offset_t off_t
-# define file_seek lseek
-#endif
+
/*
* These macros check for overflow of various quantities. These macros
@@ -450,7 +433,7 @@ H5FD_log_open(const char *name, unsigned flags, hid_t fapl_id,
file->op = OP_UNKNOWN;
#ifdef WIN32
filehandle = _get_osfhandle(fd);
- results = GetFileInformationByHandle(filehandle, &fileinfo);
+ results = GetFileInformationByHandle((HANDLE)filehandle, &fileinfo);
file->fileindexhi = fileinfo.nFileIndexHigh;
file->fileindexlo = fileinfo.nFileIndexLow;
#else
@@ -973,7 +956,7 @@ H5FD_log_write(H5FD_t *_file, H5FD_mem_t UNUSED type, hid_t UNUSED dxpl_id, hadd
while (size>0) {
do {
assert(size==(hsize_t)((size_t)size)); /*check for overflow*/
- nbytes = HDwrite(file->fd, buf, (size_t)size);
+ nbytes = HDwrite(file->fd, (void*)buf, (size_t)size);
} while (-1==nbytes && EINTR==errno);
if (-1==nbytes) {
/* error */
diff --git a/src/H5FDsec2.c b/src/H5FDsec2.c
index 0e731c4..d76ef15 100644
--- a/src/H5FDsec2.c
+++ b/src/H5FDsec2.c
@@ -75,29 +75,7 @@ typedef struct H5FD_sec2_t {
#endif
} 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. */
-
-#ifdef H5_HAVE_LSEEK64
-# define file_offset_t off64_t
-# define file_seek lseek64
-#elif defined WIN32
-# define file_offset_t __int64
-# define file_seek _lseeki64
-#else
-# define file_offset_t off_t
-# define file_seek lseek
-#endif
+
/*
@@ -659,7 +637,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, buf, (size_t)size);
+ nbytes = HDwrite(file->fd, (void*)buf, (size_t)size);
} while (-1==nbytes && EINTR==errno);
if (-1==nbytes) {
/* error */
diff --git a/src/H5FDsrb.c b/src/H5FDsrb.c
index dadff6a..7071d8d 100644
--- a/src/H5FDsrb.c
+++ b/src/H5FDsrb.c
@@ -21,13 +21,7 @@ static hid_t H5FD_SRB_g = 0;
#ifdef H5_HAVE_SRB
-#ifdef H5_HAVE_LSEEK64
-# define file_offset_t off64_t
-# define file_seek lseek64
-#else
-# define file_offset_t off_t
-# define file_seek lseek
-#endif
+
/*
* These macros check for overflow of various quantities. These macros
diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c
index 48c5ba3..6463fcb 100644
--- a/src/H5FDstdio.c
+++ b/src/H5FDstdio.c
@@ -17,10 +17,8 @@
#ifdef H5_HAVE_UNISTD_H
#include <unistd.h>
#endif
-#ifdef WIN32
-#include <windows.h>
-#include <io.h>
-#endif
+
+
#include "hdf5.h"
diff --git a/src/H5Oefl.c b/src/H5Oefl.c
index c5ac308..de6595b 100644
--- a/src/H5Oefl.c
+++ b/src/H5Oefl.c
@@ -537,7 +537,7 @@ H5O_efl_write (H5F_t UNUSED *f, const H5O_efl_t *efl, haddr_t addr,
"unable to seek in external raw data file");
}
to_write = MIN(efl->slot[i].size-skip, size);
- if ((size_t)HDwrite (fd, buf, to_write)!=to_write) {
+ if ((size_t)HDwrite (fd, (void*)buf, to_write)!=to_write) {
HGOTO_ERROR (H5E_EFL, H5E_READERROR, FAIL,
"write error in external raw data file");
}
diff --git a/src/H5Omtime.c b/src/H5Omtime.c
index 12b5049..316ce38 100644
--- a/src/H5Omtime.c
+++ b/src/H5Omtime.c
@@ -13,7 +13,7 @@
#include "H5MMprivate.h"
#include "H5Oprivate.h"
-#if defined WIN32
+#if defined (WIN32) && !defined (__MWERKS__)
#include <sys/types.h>
#include <sys/timeb.h>
#endif
@@ -145,7 +145,7 @@ H5O_mtime_decode(H5F_t UNUSED *f, const uint8_t *p,
}
the_time -= tz.tz_minuteswest*60 - (tm.tm_isdst?3600:0);
}
-#elif defined WIN32
+#elif defined (WIN32) && !defined (__MWERKS__)
{
struct timeb timebuffer;
diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h
index 0b855bb..60fe44f 100644
--- a/src/H5Ppublic.h
+++ b/src/H5Ppublic.h
@@ -20,6 +20,7 @@
/* Default Template for creation, access, etc. templates */
#define H5P_DEFAULT 0
+#include "H5private.h"
/* Public headers needed by this file */
#include "H5public.h"
#include "H5Ipublic.h"
diff --git a/src/H5Vprivate.h b/src/H5Vprivate.h
index dabfe19..df8fe44 100644
--- a/src/H5Vprivate.h
+++ b/src/H5Vprivate.h
@@ -95,7 +95,7 @@ __DLL__ hsize_t H5V_array_offset(uintn n, const hsize_t *total_size,
*
*-------------------------------------------------------------------------
*/
-static inline hsize_t UNUSED
+static H5_inline hsize_t UNUSED
H5V_vector_reduce_product(uintn n, const hsize_t *v)
{
size_t ans = 1;
@@ -122,7 +122,7 @@ H5V_vector_reduce_product(uintn n, const hsize_t *v)
*
*-------------------------------------------------------------------------
*/
-static inline htri_t UNUSED
+static H5_inline htri_t UNUSED
H5V_vector_zerop_u(intn n, const hsize_t *v)
{
if (!v) return TRUE;
@@ -149,7 +149,7 @@ H5V_vector_zerop_u(intn n, const hsize_t *v)
*
*-------------------------------------------------------------------------
*/
-static inline htri_t UNUSED
+static H5_inline htri_t UNUSED
H5V_vector_zerop_s(intn n, const hssize_t *v)
{
if (!v) return TRUE;
@@ -178,7 +178,7 @@ H5V_vector_zerop_s(intn n, const hssize_t *v)
*
*-------------------------------------------------------------------------
*/
-static inline intn UNUSED
+static H5_inline intn UNUSED
H5V_vector_cmp_u (intn n, const hsize_t *v1, const hsize_t *v2)
{
if (v1 == v2) return 0;
@@ -211,7 +211,7 @@ H5V_vector_cmp_u (intn n, const hsize_t *v1, const hsize_t *v2)
*
*-------------------------------------------------------------------------
*/
-static inline intn UNUSED
+static H5_inline intn UNUSED
H5V_vector_cmp_s (uintn n, const hssize_t *v1, const hssize_t *v2)
{
if (v1 == v2) return 0;
@@ -239,7 +239,7 @@ H5V_vector_cmp_s (uintn n, const hssize_t *v1, const hssize_t *v2)
*
*-------------------------------------------------------------------------
*/
-static inline void UNUSED
+static H5_inline void UNUSED
H5V_vector_inc(intn n, hsize_t *v1, const hsize_t *v2)
{
while (n--) *v1++ += *v2++;
diff --git a/src/H5private.h b/src/H5private.h
index ad028bd..287439d 100644
--- a/src/H5private.h
+++ b/src/H5private.h
@@ -9,6 +9,10 @@
* define common things which are not defined in the HDF5 API.
* The configuration constants like H5_HAVE_UNISTD_H etc. are
* defined in H5config.h which is included by H5public.h.
+ *
+ * Modifications:
+ * Pedro Vicente <pvn@ncsa.uiuc.edu>, June 2001
+ * WIN32 modifications
*/
#ifndef _H5private_H
#define _H5private_H
@@ -131,21 +135,96 @@
# include <sys/proc.h>
#endif
+#ifdef WIN32
+
/*
- * Win32 is severely broken when it comes to ANSI-C and Posix.1 compliance.
+ * we need this from <windows.h>
+ * HDF5 is currently supported on _X86_
+ * including <windows.h> has the side effect of introducing thousands of Windows GUI
+ * macros and type declarations to the compilation environment, so we don't include it
+ * pvn
*/
-#ifdef H5_HAVE_IO_H
-# include <io.h>
+
+#if !defined(_68K_) && !defined(_MPPC_) && !defined(_PPC_) && !defined(_ALPHA_) && !defined(_MIPS_) && !defined(_X86_) && defined(_M_IX86)
+#define _X86_
+#endif
+
+#include <windef.h>
+#include <winbase.h>
+
+/* H5_inline */
+
+/* remove any previous defs made by configure in unix */
+#ifdef H5_inline
+# undef H5_inline
#endif
-#ifdef H5_HAVE_WINDOWS_H
-#include <windows.h>
+
+/*
+sintax:
+
+inline function_declarator; // C++ Specific
+__inline function_declarator; // Microsoft Specific
+The inline and __inline keywords allow the compiler to insert a copy of
+the function body into each place the function is called
+
+inline is now in C but in the C99 standard and not the old C89 version so
+MS doesn't recognize it yet (as of April 2001)
+*/
+#if defined(__MWERKS__) || defined(__cplusplus)
+# define H5_inline inline
+# else
+# define H5_inline
#endif
+/*__MWERKS__*/
+
-#ifdef WIN32
-#include <io.h>
-#include <process.h>
-#include <windows.h>
+
+/* Metroworks <sys/types.h> doesn't define off_t. */
+#ifdef __MWERKS__
+typedef long off_t;
+/* Metroworks does not define EINTR in <errno.h> */
+# define EINTR 4
#endif
+/*__MWERKS__*/
+
+
+#endif
+/*WIN32*/
+
+
+
+/*
+ * 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
+
+
+
#ifndef F_OK
# define F_OK 00
# define W_OK 02