Skip to content

Commit

Permalink
slirp: Remove obsolete backward-compatibility cruft
Browse files Browse the repository at this point in the history
The slirp code does not use index() and gethostid() anymore,
so these parts can be removed without problems.
memmove() and strerror() should be available on each of the
supported platforms nowadays, too, so these wrappers are also
not needed anymore.
And we certainly also do not support Ultrix anymore, so no
need to keep the code for this platform anymore.

Signed-off-by: Thomas Huth <[email protected]>
Reviewed-by: Peter Maydell <[email protected]>
Signed-off-by: Samuel Thibault <[email protected]>
  • Loading branch information
huth authored and sthibaul committed May 16, 2016
1 parent cebee21 commit 5469fea
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 61 deletions.
21 changes: 0 additions & 21 deletions slirp/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,27 +60,6 @@ int add_exec(struct ex_list **ex_ptr, int do_pty, char *exec,
return 0;
}

#ifndef HAVE_STRERROR

/*
* For systems with no strerror
*/

extern int sys_nerr;
extern char *sys_errlist[];

char *
strerror(error)
int error;
{
if (error < sys_nerr)
return sys_errlist[error];
else
return "Unknown error.";
}

#endif


#ifdef _WIN32

Expand Down
28 changes: 0 additions & 28 deletions slirp/slirp.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,6 @@ typedef char *caddr_t;
# include <sys/bitypes.h>
#endif


#ifndef HAVE_MEMMOVE
#define memmove(x, y, z) bcopy(y, x, z)
#endif

#ifndef _WIN32
#include <sys/uio.h>
#endif
Expand All @@ -37,17 +32,6 @@ typedef char *caddr_t;
#include <arpa/inet.h>
#endif

/* Systems lacking strdup() definition in <string.h>. */
#if defined(ultrix)
char *strdup(const char *);
#endif

/* Systems lacking malloc() definition in <stdlib.h>. */
#if defined(ultrix) || defined(hcx)
void *malloc(size_t arg);
void free(void *ptr);
#endif

#ifndef NO_UNIX_SOCKETS
#include <sys/un.h>
#endif
Expand Down Expand Up @@ -259,18 +243,6 @@ void if_start(Slirp *);
void if_start(struct ttys *);
#endif

#ifndef HAVE_STRERROR
char *strerror(int error);
#endif

#ifndef HAVE_INDEX
char *index(const char *, int);
#endif

#ifndef HAVE_GETHOSTID
long gethostid(void);
#endif

#ifndef _WIN32
#include <netdb.h>
#endif
Expand Down
12 changes: 0 additions & 12 deletions slirp/slirp_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,6 @@
#define HAVE_SYS_FILIO_H
#endif

/* Define if you have strerror */
#define HAVE_STRERROR

/* Define if you have sys/bitypes.h */
#undef HAVE_SYS_BITYPES_H

Expand Down Expand Up @@ -82,15 +79,6 @@
#define HAVE_INET_ATON
#endif

/* Define if you have index() */
#define HAVE_INDEX

/* Define if you have memmove */
#define HAVE_MEMMOVE

/* Define if you have gethostid */
#define HAVE_GETHOSTID

/* Define if you DON'T have unix-domain sockets */
#undef NO_UNIX_SOCKETS
#ifdef _WIN32
Expand Down

0 comments on commit 5469fea

Please sign in to comment.