aboutsummaryrefslogtreecommitdiff
path: root/binutils/dlltool.c
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-09-25 16:22:43 +0000
committerIan Lance Taylor <ian@airs.com>1995-09-25 16:22:43 +0000
commit27fca56f9885bd3c2364c3698475038954e26725 (patch)
tree0fcf9bb6122292d7e5c99cb6691a2c33d6d6959c /binutils/dlltool.c
parent81449d47c5400f7ea20543d20c416be210caa4ac (diff)
downloadgdb-27fca56f9885bd3c2364c3698475038954e26725.zip
gdb-27fca56f9885bd3c2364c3698475038954e26725.tar.gz
gdb-27fca56f9885bd3c2364c3698475038954e26725.tar.bz2
* configure.in: Call AC_HEADER_SYS_WAIT.
* configure: Rebuild. * config.in: Rebuild. * dlltool.c: Include "libiberty.h" and "bucomm.h". Don't include <stdio.h>, <stdlib.h>, or <string.h>. Don't include <wait.h>. Include <sys/types.h>. Use HAVE_SYS_WAIT_H to control whether to include <sys/wait.h> or define the wait macros by hand. Don't declare xmalloc. (gen_lib_file): Don't assume that sprintf returns the number of characters; use strlen instead.
Diffstat (limited to 'binutils/dlltool.c')
-rw-r--r--binutils/dlltool.c34
1 files changed, 26 insertions, 8 deletions
diff --git a/binutils/dlltool.c b/binutils/dlltool.c
index 2b18bef..c3ac358 100644
--- a/binutils/dlltool.c
+++ b/binutils/dlltool.c
@@ -160,12 +160,29 @@
#define PAGE_SIZE 4096
#define PAGE_MASK (-PAGE_SIZE)
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "getopt.h"
#include "bfd.h"
-#include <wait.h>
+#include "libiberty.h"
+#include "bucomm.h"
+#include "getopt.h"
+
+#include <sys/types.h>
+
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#else
+#ifndef WIFEXITED
+#define WIFEXITED(w) (((w)&0377) == 0)
+#endif
+#ifndef WIFSIGNALED
+#define WIFSIGNALED(w) (((w)&0377) != 0177 && ((w)&~0377) == 0)
+#endif
+#ifndef WTERMSIG
+#define WTERMSIG(w) ((w) & 0177)
+#endif
+#ifndef WEXITSTATUS
+#define WEXITSTATUS(w) (((w) >> 8) & 0377)
+#endif
+#endif
char *ar_name = "ar";
char *as_name = "as";
@@ -184,7 +201,6 @@ char *def_file;
char *program_name;
char *strrchr ();
-char *xmalloc ();
char *strdup ();
static int machine;
@@ -1092,10 +1108,12 @@ gen_lib_file ()
{
if (sol == 0)
{
- sol = sprintf (outfile, "crs %s", output_filename);
+ sprintf (outfile, "crs %s", output_filename);
+ sol = strlen (outfile);
}
- sol += sprintf (outfile + sol, " %ss%d.o", prefix, i);
+ sprintf (outfile + sol, " %ss%d.o", prefix, i);
+ sol = strlen (outfile);
if (sol >100)
{