[llvm-commits] CVS: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/arscan.c commands.c dir.c file.c function.c job.c main.c make.h misc.c read.c
Chris Lattner
lattner at cs.uiuc.edu
Wed Jun 2 17:40:05 PDT 2004
Changes in directory llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make:
arscan.c updated: 1.1 -> 1.2
commands.c updated: 1.1 -> 1.2
dir.c updated: 1.1 -> 1.2
file.c updated: 1.1 -> 1.2
function.c updated: 1.1 -> 1.2
job.c updated: 1.1 -> 1.2
main.c updated: 1.3 -> 1.4
make.h updated: 1.1 -> 1.2
misc.c updated: 1.1 -> 1.2
read.c updated: 1.1 -> 1.2
---
Log message:
This benchmark is a nasty, distrurbing hell of ifdefs
I though that people didn't write this kind of stuff anymore. :(
---
Diffs of the changes: (+24 -27)
Index: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/arscan.c
diff -u llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/arscan.c:1.1 llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/arscan.c:1.2
--- llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/arscan.c:1.1 Tue Feb 17 09:50:33 2004
+++ llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/arscan.c Wed Jun 2 17:35:39 2004
@@ -29,6 +29,7 @@
#include <stdio.h>
#include <sys/types.h>
#include <sys/stat.h>
+#include <errno.h>
#if defined (USG) || defined (POSIX)
#include <fcntl.h>
@@ -399,7 +400,6 @@
register int fd;
struct ar_hdr ar_hdr;
register int i;
- extern int errno;
struct stat statbuf;
if (pos < 0)
Index: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/commands.c
diff -u llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/commands.c:1.1 llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/commands.c:1.2
--- llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/commands.c:1.1 Tue Feb 17 09:50:33 2004
+++ llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/commands.c Wed Jun 2 17:35:39 2004
@@ -342,7 +342,7 @@
int sig;
{
signal (sig, SIG_DFL);
-#ifndef USG
+#if !defined(USG) && !defined(__CYGWIN__)
(void) sigsetmask (0);
#endif
Index: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/dir.c
diff -u llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/dir.c:1.1 llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/dir.c:1.2
--- llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/dir.c:1.1 Tue Feb 17 09:50:33 2004
+++ llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/dir.c Wed Jun 2 17:35:39 2004
@@ -25,6 +25,10 @@
#define SYSNDIR
#endif /* Xenix */
+#if !defined(POSIX) && defined(__CYGWIN__)
+#define POSIX
+#endif
+
#if defined (POSIX) || defined (DIRENT) || defined (__GNU_LIBRARY__)
#include <dirent.h>
#define direct dirent
Index: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/file.c
diff -u llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/file.c:1.1 llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/file.c:1.2
--- llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/file.c:1.1 Tue Feb 17 09:50:33 2004
+++ llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/file.c Wed Jun 2 17:35:39 2004
@@ -23,8 +23,6 @@
#include <errno.h>
-extern int errno;
-
/* Hash table of files the makefile knows how to make. */
Index: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/function.c
diff -u llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/function.c:1.1 llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/function.c:1.2
--- llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/function.c:1.1 Tue Feb 17 09:50:33 2004
+++ llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/function.c Wed Jun 2 17:35:39 2004
@@ -23,7 +23,6 @@
#include "job.h"
#include <errno.h>
-extern int errno;
static char *string_glob ();
Index: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/job.c
diff -u llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/job.c:1.1 llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/job.c:1.2
--- llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/job.c:1.1 Tue Feb 17 09:50:33 2004
+++ llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/job.c Wed Jun 2 17:35:39 2004
@@ -22,6 +22,7 @@
#include "file.h"
#include "variable.h"
#include <errno.h>
+#include <signal.h>
/* Default path to search for executables. */
static char default_path[] = ":/bin:/usr/bin";
@@ -29,8 +30,6 @@
/* Default shell to use. */
char default_shell[] = "/bin/sh";
-extern int errno;
-
#if defined(POSIX) || defined(__GNU_LIBRARY__)
#include <limits.h>
#include <unistd.h>
@@ -101,7 +100,7 @@
#endif /* WTERMSIG defined or USG and don't have <sys/wait.h>. */
-#if defined(__GNU_LIBRARY__) || defined(POSIX)
+#if defined(__GNU_LIBRARY__) || defined(POSIX) || defined(__CYGWIN__)
#include <sys/types.h>
#define GID_T gid_t
@@ -128,8 +127,7 @@
extern int start_remote_job_p ();
extern int start_remote_job (), remote_status ();
-
-#if (defined(USG) && !defined(HAVE_SIGLIST)) || defined(DGUX)
+#if (defined(USG) && !defined(HAVE_SIGLIST)) || defined(DGUX) || defined(__CYGWIN__)
static char *sys_siglist[NSIG];
void init_siglist ();
#else /* Not (USG and HAVE_SIGLIST), or DGUX. */
@@ -180,10 +178,12 @@
extern int fatal_signal_mask;
-#ifdef USG
+#if defined(USG) || defined(__CYGWIN__)
+
/* Set nonzero in the interval when it's possible that we may see a dead
child that's not in the `children' chain. */
static int unknown_children_possible = 0;
+
#endif
@@ -192,7 +192,7 @@
static void
block_signals ()
{
-#ifdef USG
+#if defined(USG) || defined(__CYGWIN__)
/* Tell child_handler that it might see children that aren't yet
in the `children' chain. */
@@ -216,7 +216,7 @@
static void
unblock_signals ()
{
-#ifdef USG
+#if defined(USG) || defined(__CYGWIN__)
(void) SIGNAL (SIGCLD, child_handler);
@@ -1243,7 +1243,7 @@
return argv;
}
-#if (defined(USG) && !defined(HAVE_SIGLIST)) || defined(DGUX)
+#if (defined(USG) && !defined(HAVE_SIGLIST)) || defined(DGUX) || defined(__CYGWIN__)
/* Initialize sys_siglist. */
void
@@ -1274,9 +1274,11 @@
case SIGTRAP:
sys_siglist[i] = "Trace Trap";
break;
+#ifdef SIGIOT
case SIGIOT:
sys_siglist[i] = "IOT Trap";
break;
+#endif
#ifdef SIGEMT
case SIGEMT:
sys_siglist[i] = "EMT Trap";
Index: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/main.c
diff -u llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/main.c:1.3 llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/main.c:1.4
--- llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/main.c:1.3 Mon Apr 5 11:39:53 2004
+++ llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/main.c Wed Jun 2 17:35:39 2004
@@ -313,7 +313,9 @@
FATAL_SIG (SIGINT);
FATAL_SIG (SIGILL);
FATAL_SIG (SIGTRAP);
+#ifdef SIGIOT
FATAL_SIG (SIGIOT);
+#endif
#ifdef SIGEMT
FATAL_SIG (SIGEMT);
#endif
Index: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/make.h
diff -u llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/make.h:1.1 llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/make.h:1.2
--- llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/make.h:1.1 Tue Feb 17 09:50:33 2004
+++ llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/make.h Wed Jun 2 17:35:39 2004
@@ -212,16 +212,13 @@
#define VFORK_NAME "vfork"
#endif /* USG and don't have vfork. */
-#if defined(__GNU_LIBRARY__) || defined(POSIX)
+#if defined(__GNU_LIBRARY__) || defined(POSIX) || defined(__CYGWIN__)
#include <unistd.h>
+#include <signal.h>
#else
-#ifndef USG
-extern int sigsetmask ();
-extern int sigblock ();
-#endif
extern int kill ();
extern void abort (), exit ();
extern int unlink (), stat ();
Index: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/misc.c
diff -u llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/misc.c:1.1 llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/misc.c:1.2
--- llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/misc.c:1.1 Tue Feb 17 09:50:33 2004
+++ llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/misc.c Wed Jun 2 17:35:39 2004
@@ -17,6 +17,7 @@
#include "make.h"
#include "dep.h"
+#include <errno.h>
/* Compare strings *S1 and *S2.
@@ -273,9 +274,6 @@
perror_with_name (str, name)
char *str, *name;
{
- extern int errno, sys_nerr;
- extern const char * const sys_errlist[];
-
if (errno < sys_nerr)
error ("%s%s: %s", str, name, sys_errlist[errno]);
else
@@ -288,9 +286,6 @@
pfatal_with_name (name)
char *name;
{
- extern int errno, sys_nerr;
- extern const char *const sys_errlist[];
-
if (errno < sys_nerr)
fatal ("%s: %s", name, sys_errlist[errno]);
else
@@ -481,7 +476,7 @@
}
#endif
-#if !defined(POSIX) && !defined(__GNU_LIBRARY__)
+#if !defined(POSIX) && !defined(__GNU_LIBRARY__) && !defined(__CYGWIN__)
extern int getuid (), getgid (), geteuid (), getegid ();
#ifdef USG
extern int setuid (), setgid ();
Index: llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/read.c
diff -u llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/read.c:1.1 llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/read.c:1.2
--- llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/read.c:1.1 Tue Feb 17 09:50:33 2004
+++ llvm/test/Programs/MultiSource/Benchmarks/MallocBench/make/read.c Wed Jun 2 17:35:39 2004
@@ -22,7 +22,7 @@
#include "variable.h"
/* This is POSIX.2, but most systems using -DPOSIX probably don't have it. */
-#ifdef __GNU_LIBRARY__
+#if defined(__GNU_LIBRARY__) || defined(__CYGWIN__)
#include <glob.h>
#else
#include "glob/glob.h"
More information about the llvm-commits
mailing list