diff options
author | Anton Korobeynikov <asl@math.spbu.ru> | 2007-10-06 00:04:11 +0000 |
---|---|---|
committer | Anton Korobeynikov <asl@math.spbu.ru> | 2007-10-06 00:04:11 +0000 |
commit | 05955cb5fa8731ecc49480f854d335019c607993 (patch) | |
tree | 320668784ae198eff158a2ede5688d7de17f3964 | |
parent | f05697a3862aa458480e5a53cbb40fa70d73ec48 (diff) |
Another bunch of mingw32 fixes here and there
git-svn-id: https://llvm.org/svn/llvm-project/test-suite/trunk@42667 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | MultiSource/Applications/SIBsim4/sim4.init.c | 2 | ||||
-rwxr-xr-x | MultiSource/Applications/lambda-0.1.3/lambda.cc | 6 | ||||
-rw-r--r-- | MultiSource/Benchmarks/FreeBench/analyzer/analyzer.c | 1 | ||||
-rw-r--r-- | MultiSource/Benchmarks/FreeBench/distray/distray.c | 1 | ||||
-rw-r--r-- | MultiSource/Benchmarks/FreeBench/fourinarow/fourinarow.c | 1 | ||||
-rw-r--r-- | MultiSource/Benchmarks/MallocBench/espresso/utility.c | 6 | ||||
-rw-r--r-- | MultiSource/Benchmarks/Olden/bh/util.c | 18 | ||||
-rw-r--r-- | MultiSource/Benchmarks/Olden/em3d/util.c | 6 | ||||
-rw-r--r-- | MultiSource/Benchmarks/Olden/tsp/build.c | 4 | ||||
-rw-r--r-- | MultiSource/Benchmarks/Olden/tsp/tsp.h | 1 | ||||
-rw-r--r-- | MultiSource/Benchmarks/Olden/voronoi/newvor.c | 2 | ||||
-rw-r--r-- | MultiSource/Benchmarks/sim/sim.c | 4 |
12 files changed, 22 insertions, 30 deletions
diff --git a/MultiSource/Applications/SIBsim4/sim4.init.c b/MultiSource/Applications/SIBsim4/sim4.init.c index 1529f68f..a5ace7bf 100644 --- a/MultiSource/Applications/SIBsim4/sim4.init.c +++ b/MultiSource/Applications/SIBsim4/sim4.init.c @@ -119,7 +119,9 @@ main(int argc, char *argv[]) if (setlocale(LC_ALL, "POSIX") == NULL) fprintf(stderr, "%s: Warning: could not set locale to POSIX\n", argv[0]); signal(SIGSEGV, bug_handler); +#ifndef __MINGW32__ signal(SIGBUS, bug_handler); +#endif /* Default options. */ options.C = DEFAULT_C; options.cutoff = DIST_CUTOFF; diff --git a/MultiSource/Applications/lambda-0.1.3/lambda.cc b/MultiSource/Applications/lambda-0.1.3/lambda.cc index 110e7c88..4247998b 100755 --- a/MultiSource/Applications/lambda-0.1.3/lambda.cc +++ b/MultiSource/Applications/lambda-0.1.3/lambda.cc @@ -38,11 +38,7 @@ http://www.gnu.org/copyleft/gpl.html #include <sys/param.h> #endif -#ifdef WIN32 -void -#else int -#endif main(int argc, char** argv) { printf( @@ -233,8 +229,6 @@ main(int argc, char** argv) } } tokstr.close(); -#ifndef WIN32 return 0; -#endif } diff --git a/MultiSource/Benchmarks/FreeBench/analyzer/analyzer.c b/MultiSource/Benchmarks/FreeBench/analyzer/analyzer.c index 68e1e23c..a59b185d 100644 --- a/MultiSource/Benchmarks/FreeBench/analyzer/analyzer.c +++ b/MultiSource/Benchmarks/FreeBench/analyzer/analyzer.c @@ -2,7 +2,6 @@ #include <stdlib.h> #include <string.h> #include <sys/time.h> -#include <sys/resource.h> #include <unistd.h> #include "version.h" #include "types.h" diff --git a/MultiSource/Benchmarks/FreeBench/distray/distray.c b/MultiSource/Benchmarks/FreeBench/distray/distray.c index d55176a6..fc9b863f 100644 --- a/MultiSource/Benchmarks/FreeBench/distray/distray.c +++ b/MultiSource/Benchmarks/FreeBench/distray/distray.c @@ -2,7 +2,6 @@ #include <math.h> #include <stdlib.h> #include <sys/time.h> -#include <sys/resource.h> #include <unistd.h> /* Simple raytracer diff --git a/MultiSource/Benchmarks/FreeBench/fourinarow/fourinarow.c b/MultiSource/Benchmarks/FreeBench/fourinarow/fourinarow.c index b31358c8..1eaca320 100644 --- a/MultiSource/Benchmarks/FreeBench/fourinarow/fourinarow.c +++ b/MultiSource/Benchmarks/FreeBench/fourinarow/fourinarow.c @@ -31,7 +31,6 @@ #include <string.h> #include <stdlib.h> #include <sys/time.h> -#include <sys/resource.h> #include <unistd.h> /* 64 bit type needed */ diff --git a/MultiSource/Benchmarks/MallocBench/espresso/utility.c b/MultiSource/Benchmarks/MallocBench/espresso/utility.c index f59235b4..40296d8d 100644 --- a/MultiSource/Benchmarks/MallocBench/espresso/utility.c +++ b/MultiSource/Benchmarks/MallocBench/espresso/utility.c @@ -36,8 +36,12 @@ #endif #endif +#ifdef __MINGW32__ +#define IBMPC +#endif + /* default */ -#if !defined(BSD) && !defined(UNIX10) && !defined(UNIX60) && !defined(UNIX100) && !defined(UNIX50) +#if !defined(BSD) && !defined(UNIX10) && !defined(UNIX60) && !defined(UNIX100) && !defined(UNIX50) && !defined(IBMPC) #define BSD #endif diff --git a/MultiSource/Benchmarks/Olden/bh/util.c b/MultiSource/Benchmarks/Olden/bh/util.c index 2a58e740..802e1f6a 100644 --- a/MultiSource/Benchmarks/Olden/bh/util.c +++ b/MultiSource/Benchmarks/Olden/bh/util.c @@ -43,24 +43,6 @@ double xrand(double xl, double xh, double r) /* - * CPUTIME: compute CPU time in min. - */ - -#include <sys/types.h> -#include <sys/times.h> - -# define HZ 60.0 - -double cputime() -{ - struct tms buffer; - - if (times(&buffer) == -1) - error("times() call failed\n"); - return (buffer.tms_utime / (60.0 * HZ)); -} - -/* * ERROR: scream and die quickly. */ diff --git a/MultiSource/Benchmarks/Olden/em3d/util.c b/MultiSource/Benchmarks/Olden/em3d/util.c index d887120f..9528f18a 100644 --- a/MultiSource/Benchmarks/Olden/em3d/util.c +++ b/MultiSource/Benchmarks/Olden/em3d/util.c @@ -7,7 +7,13 @@ #define chatting printf #endif +#ifdef __MINGW32__ +#define srand48(x) srand(x) +#define lrand48() (rand() << 16 | rand()) +#define drand48() (1.0*rand() / RAND_MAX) +#else extern double drand48(); +#endif static int percentcheck=0,numlocal=0; diff --git a/MultiSource/Benchmarks/Olden/tsp/build.c b/MultiSource/Benchmarks/Olden/tsp/build.c index 91e94af5..d3b095a0 100644 --- a/MultiSource/Benchmarks/Olden/tsp/build.c +++ b/MultiSource/Benchmarks/Olden/tsp/build.c @@ -17,6 +17,10 @@ #ifdef TORONTO #include <math.h> +#ifdef __MINGW32__ +#define drand48() (1.0 * rand() / RAND_MAX) +#define srand48(x) srand(x) +#endif #else extern double drand48(); extern void srand48(long seedval); diff --git a/MultiSource/Benchmarks/Olden/tsp/tsp.h b/MultiSource/Benchmarks/Olden/tsp/tsp.h index 0a106e39..e3d946bf 100644 --- a/MultiSource/Benchmarks/Olden/tsp/tsp.h +++ b/MultiSource/Benchmarks/Olden/tsp/tsp.h @@ -7,7 +7,6 @@ extern int NumNodes, NDim; extern int flag; -double drand48(void); int atoi(const char *); int dealwithargs(int argc, char *argv[]); diff --git a/MultiSource/Benchmarks/Olden/voronoi/newvor.c b/MultiSource/Benchmarks/Olden/voronoi/newvor.c index 740cb85e..42da1398 100644 --- a/MultiSource/Benchmarks/Olden/voronoi/newvor.c +++ b/MultiSource/Benchmarks/Olden/voronoi/newvor.c @@ -165,7 +165,7 @@ QUAD_EDGE next_edge, avail_edge; void delete_all_edges() { next_edge= 0; avail_edge = NYL;} -#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) +#if defined(__APPLE__) || defined(__FreeBSD__) || defined(__OpenBSD__) || defined(__MINGW32__) #define MEMALIGN_IS_NOT_AVAILABLE #endif diff --git a/MultiSource/Benchmarks/sim/sim.c b/MultiSource/Benchmarks/sim/sim.c index 4735ecdd..c8839aab 100644 --- a/MultiSource/Benchmarks/sim/sim.c +++ b/MultiSource/Benchmarks/sim/sim.c @@ -88,6 +88,10 @@ programs. #include <string.h> #define long int +#ifdef __MINGW32__ +#undef UNIX +#endif + /* ckalloc - allocate space; check for success */ #if 1 #define ckalloc(x) malloc(x) |