[svn-r19796] Bug 2091: remove all Metraowerks compiler code bracheted by __MWERKS__.

Metraowerks compiler is no more. Make the code cleaner.

Tested: H5committest plus jam serial.
This commit is contained in:
Albert Cheng 2010-11-16 16:40:04 -05:00
parent 69a5317860
commit c249ccfd15
10 changed files with 26 additions and 110 deletions

View File

@ -21,15 +21,6 @@
/* See H5private.h for how to include headers */
#include "hdf5.h"
#if defined (__MWERKS__)
#ifdef H5_HAVE_SYS_TIMEB
#undef H5_HAVE_SYS_TIMEB
#endif
#ifdef H5_HAVE_SYSTEM
#undef H5_HAVE_SYSTEM
#endif
#endif /* __MWERKS__*/
#include "H5private.h"
#ifdef H5_HAVE_SYS_TIMEB

View File

@ -220,15 +220,8 @@ test(fill_t fill_style, const double splits[],
if((fspace = H5Screate_simple(1, cur_size, max_size)) < 0) goto error;
if((mspace = H5Screate_simple(1, ch_size, ch_size)) < 0) goto error;
if((dset = H5Dcreate2(file, "chunked", H5T_NATIVE_INT,
fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
#if !defined( __MWERKS__)
/*
workaround for a bug in the Metrowerks version 6.0 open function
*/
fspace, H5P_DEFAULT, dcpl, H5P_DEFAULT)) < 0) goto error;
if ((fd=HDopen(FILE_NAME_1, O_RDONLY, 0666)) < 0) goto error;
#endif
for (i=1; i<=cur_size[0]; i++) {
@ -264,8 +257,6 @@ test(fill_t fill_style, const double splits[],
}
#if !defined( __MWERKS__)
/* Determine overhead */
if (verbose) {
if (H5Fflush(file, H5F_SCOPE_LOCAL) < 0) goto error;
@ -279,7 +270,6 @@ test(fill_t fill_style, const double splits[],
(unsigned long)i,
(double)(hssize_t)(sb.st_size-i*sizeof(int))/(hssize_t)i);
}
#endif
}
@ -312,20 +302,14 @@ test(fill_t fill_style, const double splits[],
abort();
}
#if !defined( __MWERKS__)
if (HDfstat(fd, &sb) < 0) goto error;
printf("%-7s %8.3f\n", sname,
(double)(hssize_t)(sb.st_size-cur_size[0]*sizeof(int))/
(hssize_t)cur_size[0]);
#endif
}
#if !defined( __MWERKS__)
HDclose(fd);
#endif
return 0;

View File

@ -60,62 +60,41 @@ extern char *strdup(const char *s);
#endif /* _WIN32 */
H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#define HDstrcmp(S,T) strcmp(S,T)
#define HDstrlen(S) strlen(S)
#define HDstrncmp(S,T,L) strncmp(S,T,L)
#define HDstrncpy(X,Y,Z) strncpy(X,Y,Z)
#define HDstrchr(S,C) strchr(S,C)
#define HDfree(M) free(M)
#define HDstrcmp(S,T) strcmp(S,T)
#define HDstrlen(S) strlen(S)
#define HDstrncmp(S,T,L) strncmp(S,T,L)
#define HDstrncpy(X,Y,Z) strncpy(X,Y,Z)
#define HDstrchr(S,C) strchr(S,C)
#define HDfree(M) free(M)
#ifdef _O_BINARY
#define HDopen(S,F,M) open(S,F|_O_BINARY,M)
#define HDopen(S,F,M) open(S,F|_O_BINARY,M)
#else
#define HDopen(S,F,M) open(S,F,M)
#define HDopen(S,F,M) open(S,F,M)
#endif
#define HDclose(F) close(F)
#define HDclose(F) close(F)
#ifdef _WIN32
#ifdef __MWERKS__
#define HDlseek(F,O,W) lseek(F,O,W)
#else /*MSVS */
#define HDlseek(F,O,W) _lseeki64(F,O,W)
#endif
#define HDlseek(F,O,W) _lseeki64(F,O,W)
#else
#define HDlseek(F,O,W) lseek(F,O,W)
#define HDlseek(F,O,W) lseek(F,O,W)
#endif
#if defined (__MWERKS__)
/* workaround for a bug in the Metrowerks version 6.0 header file for write
which is not defined as const void*
*/
#define HDwrite(F,M,Z) write(F,(void*)M,Z)
#else
#define HDwrite(F,M,Z) write(F,M,Z)
#endif
#define HDread(F,M,Z) read(F,M,Z)
#ifdef _WIN32
#ifdef __MWERKS__
#define HDstat(S,B) stat(S,B)
#else /*MSVC*/
#define HDstat(S,B) _stati64(S,B)
#endif
#else
#define HDstat(S,B) stat(S,B)
#endif
#ifdef _WIN32
#ifdef __MWERKS__
#define HDfstat(F,B) fstat(F,B)
typedef struct stat h5_stat_t;
typedef off_t h5_stat_size_t;
#else /*MSVC*/
#define HDfstat(F,B) _fstati64(F,B)
typedef struct _stati64 h5_stat_t;
typedef __int64 h5_stat_size_t;
#endif
#define HDfstat(F,B) _fstati64(F,B)
typedef struct _stati64 h5_stat_t;
typedef __int64 h5_stat_size_t;
#else
#define HDfstat(F,B) fstat(F,B)
typedef struct stat h5_stat_t;

View File

@ -114,12 +114,7 @@
#define HDexecve(S,AV,E) execve(S,AV,E)
#define HDexecvp(S,AV) execvp(S,AV)
#define HDexit(N) exit(N)
#if defined __MWERKS__
#include <abort_exit.h>
#define HD_exit(N) __exit(N)
#else /* __MWERKS __ */
#define HD_exit(N) _exit(N)
#endif /* __MWERKS __ */
#define HDexp(X) exp(X)
#define HDfabs(X) fabs(X)
/* use ABS() because fabsf() fabsl() are not common yet. */
@ -175,19 +170,11 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
* xxx64 versions if available.
*/
#ifdef _WIN32
#ifdef __MWERKS__
#define HDfstat(F,B) fstat(F,B)
#define HDlstat(S,B) lstat(S,B)
#define HDstat(S,B) stat(S,B)
typedef struct stat h5_stat_t;
typedef off_t h5_stat_size_t;
#else /*MSVC*/
#define HDfstat(F,B) _fstati64(F,B)
#define HDlstat(S,B) _lstati64(S,B)
#define HDstat(S,B) _stati64(S,B)
typedef struct _stati64 h5_stat_t;
typedef __int64 h5_stat_size_t;
#endif
#elif H5_SIZEOF_OFF_T!=8 && H5_SIZEOF_OFF64_T==8 && defined(H5_HAVE_STAT64)
#define HDfstat(F,B) fstat64(F,B)
#define HDlstat(S,B) lstat64(S,B)
@ -249,17 +236,13 @@ H5_DLL int HDfprintf (FILE *stream, const char *fmt, ...);
#define HDlog10(X) log10(X)
#define HDlongjmp(J,N) longjmp(J,N)
#ifdef _WIN32
#ifdef __MWERKS__
#define HDlseek(F,O,W) lseek(F,O,W)
#else /*MSVS */
#define HDlseek(F,O,W) _lseeki64(F,O,W)
#endif
#define HDlseek(F,O,W) _lseeki64(F,O,W)
#else
#ifdef H5_HAVE_LSEEK64
#ifdef H5_HAVE_LSEEK64
#define HDlseek(F,O,W) lseek64(F,O,W)
#else
#else
#define HDlseek(F,O,W) lseek(F,O,W)
#endif
#endif
#endif
#define HDmalloc(Z) malloc(Z)
#define HDposix_memalign(P,A,Z) posix_memalign(P,A,Z)
@ -454,15 +437,7 @@ H5_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 version 6.0 header file for write
which is not defined as const void*
*/
#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

View File

@ -62,10 +62,6 @@
# define fileno(file) file->__file
#endif /* RISCOS */
#if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os
# include <unix.h> /* for fileno */
#endif /* __MWERKS__ ... */
#ifndef GZ_SUFFIX
# define GZ_SUFFIX ".gz"
#endif /* GZ_SUFFIX */

View File

@ -120,7 +120,7 @@ typedef struct H5FD_direct_t {
# define file_offset_t off64_t
# define file_seek lseek64
# define file_truncate ftruncate64
#elif defined (_WIN32) && !defined(__MWERKS__)
#elif defined (_WIN32)
# /*MSVC*/
# define file_offset_t __int64
# define file_seek _lseeki64

View File

@ -135,13 +135,9 @@ typedef struct H5FD_log_t {
# 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
# /*MSVC*/
# define file_offset_t __int64
# define file_seek _lseeki64
#else
# define file_offset_t off_t
# define file_seek lseek

View File

@ -138,7 +138,7 @@ typedef struct H5FD_mpiposix_t {
# define file_offset_t off64_t
# define file_seek lseek64
# define file_truncate ftruncate64
#elif defined (_WIN32) && !defined(__MWERKS__)
#elif defined (_WIN32)
# /*MSVC*/
# define file_offset_t __int64
# define file_seek _lseeki64

View File

@ -56,12 +56,7 @@ typedef __int64 h5_stat_size_t;
#endif /* H5_HAVE_GETTIMEOFDAY */
#define HDgetdrive() _getdrive()
#define HDlseek(F,O,W) _lseeki64(F,O,W)
#if !defined(__MWERKS__)
# /*MSVC*/
# define HDoff_t __int64
#else
# define HDoff_t off_t
#endif
#define HDoff_t __int64
#define HDmemset(X,C,Z) memset((void*)(X),C,Z)
#define HDmkdir(S,M) _mkdir(S)
#define HDopen(S,F,M) _open(S,F|_O_BINARY,M)

View File

@ -124,7 +124,7 @@ AddTest(const char *TheName, void (*TheCall) (void), void (*Cleanup) (void), con
*/
void TestInit(const char *ProgName, void (*private_usage)(void), int (*private_parser)(int ac, char *av[]))
{
#if !(defined MAC || defined __MWERKS__ || defined SYMANTEC_C)
#if !(defined MAC)
/* Un-buffer the stdout and stderr */
setbuf(stderr, NULL);
setbuf(stdout, NULL);