From c249ccfd1502c428b820d6316a5cf7a0a9d5ca82 Mon Sep 17 00:00:00 2001 From: Albert Cheng Date: Tue, 16 Nov 2010 16:40:04 -0500 Subject: [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. --- perform/iopipe.c | 9 --------- perform/overhead.c | 18 +----------------- perform/pio_standalone.h | 49 ++++++++++++++---------------------------------- perform/sio_standalone.h | 33 ++++---------------------------- perform/zip_perf.c | 4 ---- src/H5FDdirect.c | 2 +- src/H5FDlog.c | 10 +++------- src/H5FDmpiposix.c | 2 +- src/H5win32defs.h | 7 +------ test/testframe.c | 2 +- 10 files changed, 26 insertions(+), 110 deletions(-) diff --git a/perform/iopipe.c b/perform/iopipe.c index 77d4fc8..a67c5c8 100644 --- a/perform/iopipe.c +++ b/perform/iopipe.c @@ -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 diff --git a/perform/overhead.c b/perform/overhead.c index 5076103..cfd96b8 100644 --- a/perform/overhead.c +++ b/perform/overhead.c @@ -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; diff --git a/perform/pio_standalone.h b/perform/pio_standalone.h index ab4ee94..a4bc8b5 100644 --- a/perform/pio_standalone.h +++ b/perform/pio_standalone.h @@ -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; diff --git a/perform/sio_standalone.h b/perform/sio_standalone.h index 7c4810b..77bb7f8 100644 --- a/perform/sio_standalone.h +++ b/perform/sio_standalone.h @@ -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 -#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 diff --git a/perform/zip_perf.c b/perform/zip_perf.c index 7d96405..08177d8 100644 --- a/perform/zip_perf.c +++ b/perform/zip_perf.c @@ -62,10 +62,6 @@ # define fileno(file) file->__file #endif /* RISCOS */ -#if defined(__MWERKS__) && __dest_os != __be_os && __dest_os != __win32_os -# include /* for fileno */ -#endif /* __MWERKS__ ... */ - #ifndef GZ_SUFFIX # define GZ_SUFFIX ".gz" #endif /* GZ_SUFFIX */ diff --git a/src/H5FDdirect.c b/src/H5FDdirect.c index 70b33f7..29fd84f 100644 --- a/src/H5FDdirect.c +++ b/src/H5FDdirect.c @@ -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 diff --git a/src/H5FDlog.c b/src/H5FDlog.c index c21fc92..9e81c42 100644 --- a/src/H5FDlog.c +++ b/src/H5FDlog.c @@ -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 diff --git a/src/H5FDmpiposix.c b/src/H5FDmpiposix.c index 5bea8fe..7ca38cc 100644 --- a/src/H5FDmpiposix.c +++ b/src/H5FDmpiposix.c @@ -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 diff --git a/src/H5win32defs.h b/src/H5win32defs.h index d478e4c..fb37059 100644 --- a/src/H5win32defs.h +++ b/src/H5win32defs.h @@ -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) diff --git a/test/testframe.c b/test/testframe.c index 082a27f..6fbace1 100644 --- a/test/testframe.c +++ b/test/testframe.c @@ -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); -- cgit v0.12