diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2001-07-03 14:49:03 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2001-07-03 14:49:03 (GMT) |
commit | f9f0de7aa0529a0467e79b4521013328fab1e3e7 (patch) | |
tree | 83e73aec2d76e64e158ae3de0fbfc138a0dcef08 /src | |
parent | f72cb07b0ac15e511de8c735f02713fb815079e9 (diff) | |
download | hdf5-f9f0de7aa0529a0467e79b4521013328fab1e3e7.zip hdf5-f9f0de7aa0529a0467e79b4521013328fab1e3e7.tar.gz hdf5-f9f0de7aa0529a0467e79b4521013328fab1e3e7.tar.bz2 |
[svn-r4099]
Purpose:
Code Cleanup
Description:
Updating CodeWarrior Port
Solution:
Move around some Windows and Metroworks ifdefs, etc.
Platforms tested:
Solaris 2.7 (arabica) Linux 2.2 (eirene)
Diffstat (limited to 'src')
-rw-r--r-- | src/H5FDstdio.c | 15 | ||||
-rw-r--r-- | src/H5Ppublic.h | 8 | ||||
-rw-r--r-- | src/H5private.h | 49 |
3 files changed, 61 insertions, 11 deletions
diff --git a/src/H5FDstdio.c b/src/H5FDstdio.c index c852208..0aa6fe7 100644 --- a/src/H5FDstdio.c +++ b/src/H5FDstdio.c @@ -16,16 +16,23 @@ #include "hdf5.h" +#ifdef H5_HAVE_STDIO_H +#include <stdio.h> +#endif #ifdef H5_HAVE_UNISTD_H #include <unistd.h> #endif #ifdef WIN32 -#include <windows.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> + #include <io.h> -#endif /*kent yang 6/21/2001, must be added for defination of open,write.... - also the defination of longlong is valid, will investigate this to - make sure int64 can replace longlong. Otherwise, keep windows.h*/ + +#endif #ifdef MAX #undef MAX diff --git a/src/H5Ppublic.h b/src/H5Ppublic.h index 74efab1..6c49956 100644 --- a/src/H5Ppublic.h +++ b/src/H5Ppublic.h @@ -28,6 +28,14 @@ #include "H5MMpublic.h" #include "H5Zpublic.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__*/ + /* Property list classes */ typedef enum H5P_class_t { H5P_NO_CLASS = -1, /*error return value */ diff --git a/src/H5private.h b/src/H5private.h index b001d86..415c919 100644 --- a/src/H5private.h +++ b/src/H5private.h @@ -168,15 +168,38 @@ MS doesn't recognize it yet (as of April 2001) # define H5_inline #endif -/* 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. + */ + +#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 @@ -760,7 +783,19 @@ __DLL__ int64_t HDstrtoll (const char *s, const char **rest, int base); #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 header file for write + which is not defined as const void* + pvn + */ +#define HDwrite(F,M,Z) write(F,(void*)M,Z) +#else #define HDwrite(F,M,Z) write(F,M,Z) +#endif /* * And now for a couple non-Posix functions... Watch out for systems that |