diff options
author | Alan Modra <amodra@gmail.com> | 2021-04-05 15:27:37 +0930 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2021-04-05 15:27:37 +0930 |
commit | 83c79df86bf40666d1da7cd884bc10d45773df91 (patch) | |
tree | 1958fb387f15984aea41c900c959bb88c5dfb71a /bfd/sysdep.h | |
parent | 5d4d26d14ca3dcf4c2d0745df720a2a5bd1bd6a5 (diff) | |
download | gdb-83c79df86bf40666d1da7cd884bc10d45773df91.zip gdb-83c79df86bf40666d1da7cd884bc10d45773df91.tar.gz gdb-83c79df86bf40666d1da7cd884bc10d45773df91.tar.bz2 |
C99 bfd configury
Certain library headers and functions are required by C99. This
removes configure tests for them. The patch also removes AC_ISC_POSIX
and AC_HEADER_DIRENT, which the autoconf manual states are obsolescent.
sys/time.h is no longer tangled up with time.h so it can be handled by
the gprof configure.
* configure.ac: Don't check for long long or long double type.
Don't check for alloca.h, limits.h, stddef.h, stdlib.h, string.h,
strings.h, time.h, wchar.h, wctype.h or sys/time.h. Don't check
for strtoull, free, malloc, realloc, getenv, strstr, snprintf,
vsnprintf, strlen or setitimer. Sort AC_CHECK_DECLS.
(AC_ISC_POSIX): Don't invoke.
(AC_HEADER_TIME, AC_HEADER_DIRENT, ACX_HEADER_STRING): Likewise.
* sysdep.h: Remove many HAVE_*_H checks and fallback declarations.
Do test HAVE_SYS_TYPES_H. Don't include sys/time.h. Reorder
header order as per automake AC_INCLUDES_DEFAULT.
* bfd-in.h: Include inttypes.h unconditionally.
* bfd.c (_bfd_doprnt, _bfd_doprnt_scan): Assume long long and
long double are available.
(bfd_scan_vma): Assume long long and strtoull are available.
* elflink.c: Include limits.h unconditionally.
* elfnn-riscv.c: Likewise.
* wasm-module.c: Likewise.
* hpux-core.c: Include dirent.h unconditionally.
* trad-core.c: Likewise.
* hosts/x86-64linux.h: Include stdlib.h unconditionally.
* peXXigen.c: Remove HAVE_WCHAR_H and HAVE_WCTYPE_H checks.
* elf32-m68hc1x.c: Don't include alloca-conf.h.
* elf64-hppa.c: Likewise.
* som.c: Likewise.
* wasm-module.c: Likewise.
* xsym.c: Likewise.
* bfd-in2.h: Regenerate.
* config.in: Regenerate.
* configure: Regenerate.
Diffstat (limited to 'bfd/sysdep.h')
-rw-r--r-- | bfd/sysdep.h | 69 |
1 files changed, 7 insertions, 62 deletions
diff --git a/bfd/sysdep.h b/bfd/sysdep.h index c0b96ef..aa6b095 100644 --- a/bfd/sysdep.h +++ b/bfd/sysdep.h @@ -27,54 +27,23 @@ #endif #include "config.h" - -#ifdef HAVE_STDDEF_H -#include <stddef.h> -#endif - #include <stdio.h> -#include <sys/types.h> -#include <errno.h> -#if !(defined(errno) || defined(_MSC_VER) && defined(_INC_ERRNO)) -extern int errno; -#endif - -#ifdef STRING_WITH_STRINGS -#include <string.h> -#include <strings.h> -#else -#ifdef HAVE_STRING_H -#include <string.h> -#else -#ifdef HAVE_STRINGS_H -#include <strings.h> -#else -extern char *strchr (); -extern char *strrchr (); -#endif -#endif +#ifdef HAVE_SYS_TYPES_H +#include <sys/types.h> #endif -#ifdef HAVE_STDLIB_H #include <stdlib.h> -#endif - -#ifdef TIME_WITH_SYS_TIME -#include <sys/time.h> -#include <time.h> -#else -#ifdef HAVE_SYS_TIME_H -#include <sys/time.h> -#else -#include <time.h> -#endif -#endif +#include <stddef.h> +#include <string.h> #ifdef HAVE_UNISTD_H #include <unistd.h> #endif +#include <errno.h> +#include <time.h> + #ifdef HAVE_SYS_RESOURCE_H #include <sys/resource.h> #endif /* HAVE_SYS_RESOURCE_H */ @@ -123,30 +92,10 @@ extern char *strrchr (); extern int ffs (int); #endif -#if !HAVE_DECL_FREE -extern void free (); -#endif - -#if !HAVE_DECL_GETENV -extern char *getenv (); -#endif - -#if !HAVE_DECL_MALLOC -extern PTR malloc (); -#endif - -#if !HAVE_DECL_REALLOC -extern PTR realloc (); -#endif - #if !HAVE_DECL_STPCPY extern char *stpcpy (char *__dest, const char *__src); #endif -#if !HAVE_DECL_STRSTR -extern char *strstr (); -#endif - #ifdef HAVE_FTELLO #if !HAVE_DECL_FTELLO extern off_t ftello (FILE *stream); @@ -171,10 +120,6 @@ extern int fseeko64 (FILE *stream, off64_t offset, int whence); #endif #endif -#if !HAVE_DECL_STRNLEN -size_t strnlen (const char *, size_t); -#endif - /* Define offsetof for those systems which lack it */ #ifndef offsetof |