diff options
author | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2001-06-28 21:23:13 (GMT) |
---|---|---|
committer | Pedro Vicente Nunes <pvn@hdfgroup.org> | 2001-06-28 21:23:13 (GMT) |
commit | bcb587dcc2305763546acd8e3303240530cd20cf (patch) | |
tree | 5a9e89047989e529f38005725b671bd62fa1e9d7 /src/H5private.h | |
parent | 3a925f72d08e3e61602c9e3344c1f67b340057fb (diff) | |
download | hdf5-bcb587dcc2305763546acd8e3303240530cd20cf.zip hdf5-bcb587dcc2305763546acd8e3303240530cd20cf.tar.gz hdf5-bcb587dcc2305763546acd8e3303240530cd20cf.tar.bz2 |
[svn-r4081]
Purpose:
[is this a bug fix? feature? ...]
Description:
[describe the bug, or describe the new feature, etc]
Solution:
[details about the changes, algorithm, etc...]
[Please as detail as you can since your own explanation is
better than others guessing it from the code.]
Platforms tested:
[machines you have tested the changed version. This is absolute
important. Test it out on at least two or three different platforms
such as Big-endian-32bit (SUN/IRIX), little-endian-32(LINUX) and
64-bit (IRIX64/UNICOS/DEC-ALPHA) would be good.]
Diffstat (limited to 'src/H5private.h')
-rw-r--r-- | src/H5private.h | 93 |
1 files changed, 82 insertions, 11 deletions
diff --git a/src/H5private.h b/src/H5private.h index 7fc963e..256a22c 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 @@ -130,27 +134,93 @@ # 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 */ -#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 -#ifdef H5_HAVE_WINDOWS_H -# include <windows.h> + +#include <windef.h> +#include <winbase.h> +#include <io.h> + +/* H5_inline */ + +/* remove any previous defs made by configure in unix */ +#ifdef H5_inline +# undef H5_inline #endif -#ifdef WIN32 -# include <io.h> -# include <process.h> -# include <windows.h> +/* +The inline keywords allows 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 + +/* 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 # define R_OK 04 #endif + + + /* * Pablo support files. */ @@ -719,7 +789,7 @@ __DLL__ int64_t HDstrtoll (const char *s, const char **rest, int base); * And now for a couple non-Posix functions... Watch out for systems that * define these in terms of macros. */ -#ifdef WIN32 +#if defined (__MWERKS__) #define HDstrdup(S) _strdup(S) #else @@ -1059,5 +1129,6 @@ __DLL__ intn H5TN_term_interface(void); __DLL__ intn H5T_term_interface(void); __DLL__ intn H5Z_term_interface(void); - #endif + + |