From bb974a2493495923903631bab3de9f340526d353 Mon Sep 17 00:00:00 2001 From: Gary Benson Date: Wed, 30 Jul 2014 13:21:40 +0100 Subject: [PATCH] Move errno.h to common-defs.h This commit moves the inclusion of errno.h to common-defs.h and removes all other inclusions. Note that prior to this commit server.h included errno.h protected by "#ifdef HAVE_ERRNO_H". This protection was added with the Windows CE port, which is currently broken. Since no other platform needs this, I have removed the protection and the configury to support it. gdb/ 2014-08-07 Gary Benson * common/common-defs.h: Include errno.h. * defs.h: Do not include errno.h. * ada-typeprint.c: Likewise. * c-typeprint.c: Likewise. * core-regset.c: Likewise. * corefile.c: Likewise. * corelow.c: Likewise. * event-loop.c: Likewise. * f-typeprint.c: Likewise. * gnu-nat.c: Likewise. * go32-nat.c: Likewise. * i386gnu-nat.c: Likewise. * m2-typeprint.c: Likewise. * nat/linux-btrace.c: Likewise. * p-typeprint.c: Likewise. * procfs.c: Likewise. * remote-sim.c: Likewise. * rs6000-nat.c: Likewise. * target.c: Likewise. * typeprint.c: Likewise. * ui-file.c: Likewise. * valops.c: Likewise. * valprint.c: Likewise. gdb/gdbserver/ 2014-08-07 Gary Benson * configure.ac (AC_CHECK_HEADERS): Remove errno.h. * configure: Regenerate. * config.in: Likewise. * server.h: Do not include errno.h. * event-loop.c: Likewise. * hostio-errno.c: Likewise. * linux-low.c: Likewise. * remote-utils.c: Likewise. * spu-low.c: Likewise. * utils.c: Likewise. * gdbreplay.c: Unconditionally include errno.h. --- gdb/ChangeLog | 26 ++++++++++++++++++++++++++ gdb/ada-typeprint.c | 2 -- gdb/c-typeprint.c | 1 - gdb/common/common-defs.h | 1 + gdb/core-regset.c | 1 - gdb/corefile.c | 1 - gdb/corelow.c | 1 - gdb/defs.h | 1 - gdb/event-loop.c | 1 - gdb/f-typeprint.c | 1 - gdb/gdbserver/ChangeLog | 14 ++++++++++++++ gdb/gdbserver/config.in | 3 --- gdb/gdbserver/configure | 2 +- gdb/gdbserver/configure.ac | 2 +- gdb/gdbserver/event-loop.c | 4 ---- gdb/gdbserver/gdbreplay.c | 2 -- gdb/gdbserver/hostio-errno.c | 1 - gdb/gdbserver/linux-low.c | 1 - gdb/gdbserver/remote-utils.c | 3 --- gdb/gdbserver/server.h | 3 --- gdb/gdbserver/spu-low.c | 1 - gdb/gdbserver/utils.c | 3 --- gdb/gnu-nat.c | 1 - gdb/go32-nat.c | 1 - gdb/i386gnu-nat.c | 1 - gdb/m2-typeprint.c | 1 - gdb/nat/linux-btrace.c | 1 - gdb/p-typeprint.c | 1 - gdb/procfs.c | 1 - gdb/remote-sim.c | 1 - gdb/rs6000-nat.c | 1 - gdb/target.c | 1 - gdb/typeprint.c | 1 - gdb/ui-file.c | 2 -- gdb/valops.c | 1 - gdb/valprint.c | 2 -- 36 files changed, 43 insertions(+), 48 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 8cb54b0ad2..5261972379 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,29 @@ +2014-08-07 Gary Benson + + * common/common-defs.h: Include errno.h. + * defs.h: Do not include errno.h. + * ada-typeprint.c: Likewise. + * c-typeprint.c: Likewise. + * core-regset.c: Likewise. + * corefile.c: Likewise. + * corelow.c: Likewise. + * event-loop.c: Likewise. + * f-typeprint.c: Likewise. + * gnu-nat.c: Likewise. + * go32-nat.c: Likewise. + * i386gnu-nat.c: Likewise. + * m2-typeprint.c: Likewise. + * nat/linux-btrace.c: Likewise. + * p-typeprint.c: Likewise. + * procfs.c: Likewise. + * remote-sim.c: Likewise. + * rs6000-nat.c: Likewise. + * target.c: Likewise. + * typeprint.c: Likewise. + * ui-file.c: Likewise. + * valops.c: Likewise. + * valprint.c: Likewise. + 2014-08-07 Gary Benson * common/common-defs.h: Include string.h. diff --git a/gdb/ada-typeprint.c b/gdb/ada-typeprint.c index a43ced7cfb..305e39cddd 100644 --- a/gdb/ada-typeprint.c +++ b/gdb/ada-typeprint.c @@ -32,9 +32,7 @@ #include "c-lang.h" #include "typeprint.h" #include "ada-lang.h" - #include -#include static int print_selected_record_field_types (struct type *, struct type *, int, int, diff --git a/gdb/c-typeprint.c b/gdb/c-typeprint.c index 5239505b20..374c90e3be 100644 --- a/gdb/c-typeprint.c +++ b/gdb/c-typeprint.c @@ -31,7 +31,6 @@ #include "typeprint.h" #include "cp-abi.h" #include "jv-lang.h" -#include #include "cp-support.h" static void c_type_print_varspec_prefix (struct type *, diff --git a/gdb/common/common-defs.h b/gdb/common/common-defs.h index 7c678462f8..82290dc80c 100644 --- a/gdb/common/common-defs.h +++ b/gdb/common/common-defs.h @@ -32,6 +32,7 @@ #include #include #include +#include #include "ansidecl.h" #include "libiberty.h" #include "pathmax.h" diff --git a/gdb/core-regset.c b/gdb/core-regset.c index 6edc8c58c6..bdcb72a65f 100644 --- a/gdb/core-regset.c +++ b/gdb/core-regset.c @@ -34,7 +34,6 @@ #include "regcache.h" #include -#include #include #ifdef HAVE_SYS_PROCFS_H #include diff --git a/gdb/corefile.c b/gdb/corefile.c index 983caa97d7..1617392372 100644 --- a/gdb/corefile.c +++ b/gdb/corefile.c @@ -18,7 +18,6 @@ along with this program. If not, see . */ #include "defs.h" -#include #include #include #include "inferior.h" diff --git a/gdb/corelow.c b/gdb/corelow.c index ee0f655c10..ff4d733835 100644 --- a/gdb/corelow.c +++ b/gdb/corelow.c @@ -19,7 +19,6 @@ #include "defs.h" #include "arch-utils.h" -#include #include #include #ifdef HAVE_SYS_FILE_H diff --git a/gdb/defs.h b/gdb/defs.h index 710298c627..b7271a7566 100644 --- a/gdb/defs.h +++ b/gdb/defs.h @@ -28,7 +28,6 @@ #include "common-defs.h" #include -#include /* System call error return status. */ #include #include diff --git a/gdb/event-loop.c b/gdb/event-loop.c index cc2f83795e..e40187e537 100644 --- a/gdb/event-loop.c +++ b/gdb/event-loop.c @@ -31,7 +31,6 @@ #endif #include -#include #include #include "exceptions.h" #include "gdb_select.h" diff --git a/gdb/f-typeprint.c b/gdb/f-typeprint.c index 534019a4ce..74740510b9 100644 --- a/gdb/f-typeprint.c +++ b/gdb/f-typeprint.c @@ -30,7 +30,6 @@ #include "gdbcore.h" #include "target.h" #include "f-lang.h" -#include #if 0 /* Currently unused. */ static void f_type_print_args (struct type *, struct ui_file *); diff --git a/gdb/gdbserver/ChangeLog b/gdb/gdbserver/ChangeLog index 34d8bf5f57..cea7a16107 100644 --- a/gdb/gdbserver/ChangeLog +++ b/gdb/gdbserver/ChangeLog @@ -1,3 +1,17 @@ +2014-08-07 Gary Benson + + * configure.ac (AC_CHECK_HEADERS): Remove errno.h. + * configure: Regenerate. + * config.in: Likewise. + * server.h: Do not include errno.h. + * event-loop.c: Likewise. + * hostio-errno.c: Likewise. + * linux-low.c: Likewise. + * remote-utils.c: Likewise. + * spu-low.c: Likewise. + * utils.c: Likewise. + * gdbreplay.c: Unconditionally include errno.h. + 2014-08-07 Gary Benson * server.h: Do not include string.h. diff --git a/gdb/gdbserver/config.in b/gdb/gdbserver/config.in index 6ce45a661f..216c01d1f0 100644 --- a/gdb/gdbserver/config.in +++ b/gdb/gdbserver/config.in @@ -54,9 +54,6 @@ /* Define if has elf_fpregset_t. */ #undef HAVE_ELF_FPREGSET_T -/* Define to 1 if you have the header file. */ -#undef HAVE_ERRNO_H - /* Define to 1 if you have the header file. */ #undef HAVE_FCNTL_H diff --git a/gdb/gdbserver/configure b/gdb/gdbserver/configure index 5f8dcd2a11..9c1f9a830f 100755 --- a/gdb/gdbserver/configure +++ b/gdb/gdbserver/configure @@ -4904,7 +4904,7 @@ $as_echo "$as_me: running $SHELL $ac_sub_configure $ac_sub_configure_args --cach cd "$ac_popdir" -for ac_header in sgtty.h termio.h termios.h sys/reg.h string.h proc_service.h sys/procfs.h linux/elf.h errno.h fcntl.h signal.h sys/file.h malloc.h sys/ioctl.h netinet/in.h sys/socket.h netdb.h netinet/tcp.h arpa/inet.h +for ac_header in sgtty.h termio.h termios.h sys/reg.h string.h proc_service.h sys/procfs.h linux/elf.h fcntl.h signal.h sys/file.h malloc.h sys/ioctl.h netinet/in.h sys/socket.h netdb.h netinet/tcp.h arpa/inet.h do : as_ac_Header=`$as_echo "ac_cv_header_$ac_header" | $as_tr_sh` ac_fn_c_check_header_mongrel "$LINENO" "$ac_header" "$as_ac_Header" "$ac_includes_default" diff --git a/gdb/gdbserver/configure.ac b/gdb/gdbserver/configure.ac index 67866f806b..8e5d74fb72 100644 --- a/gdb/gdbserver/configure.ac +++ b/gdb/gdbserver/configure.ac @@ -82,7 +82,7 @@ ACX_CONFIGURE_DIR(["../../libiberty"], ["build-libiberty-gdbserver"]) AC_CHECK_HEADERS(sgtty.h termio.h termios.h sys/reg.h string.h dnl proc_service.h sys/procfs.h linux/elf.h dnl - errno.h fcntl.h signal.h sys/file.h malloc.h dnl + fcntl.h signal.h sys/file.h malloc.h dnl sys/ioctl.h netinet/in.h sys/socket.h netdb.h dnl netinet/tcp.h arpa/inet.h) AC_CHECK_FUNCS(pread pwrite pread64 readlink) diff --git a/gdb/gdbserver/event-loop.c b/gdb/gdbserver/event-loop.c index 1513b59f55..92c8db0e5e 100644 --- a/gdb/gdbserver/event-loop.c +++ b/gdb/gdbserver/event-loop.c @@ -29,10 +29,6 @@ #include #endif -#ifdef HAVE_ERRNO_H -#include -#endif - #include typedef struct gdb_event gdb_event; diff --git a/gdb/gdbserver/gdbreplay.c b/gdb/gdbserver/gdbreplay.c index 706fda647f..c70abef7e9 100644 --- a/gdb/gdbserver/gdbreplay.c +++ b/gdb/gdbserver/gdbreplay.c @@ -32,9 +32,7 @@ #if HAVE_FCNTL_H #include #endif -#if HAVE_ERRNO_H #include -#endif #include #include #include diff --git a/gdb/gdbserver/hostio-errno.c b/gdb/gdbserver/hostio-errno.c index 8817096517..f24b51f460 100644 --- a/gdb/gdbserver/hostio-errno.c +++ b/gdb/gdbserver/hostio-errno.c @@ -22,7 +22,6 @@ on top of errno. */ #include "server.h" -#include #include "gdb/fileio.h" static int diff --git a/gdb/gdbserver/linux-low.c b/gdb/gdbserver/linux-low.c index 9188db1a79..543987a8dc 100644 --- a/gdb/gdbserver/linux-low.c +++ b/gdb/gdbserver/linux-low.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include #include diff --git a/gdb/gdbserver/remote-utils.c b/gdb/gdbserver/remote-utils.c index f3ae3934ca..327677a0ea 100644 --- a/gdb/gdbserver/remote-utils.c +++ b/gdb/gdbserver/remote-utils.c @@ -56,9 +56,6 @@ #include #endif #include -#if HAVE_ERRNO_H -#include -#endif #if USE_WIN32API #include diff --git a/gdb/gdbserver/server.h b/gdb/gdbserver/server.h index 1e2c3a1c77..db6ddde341 100644 --- a/gdb/gdbserver/server.h +++ b/gdb/gdbserver/server.h @@ -27,9 +27,6 @@ #include "version.h" -#ifdef HAVE_ERRNO_H -#include -#endif #include #ifdef HAVE_ALLOCA_H diff --git a/gdb/gdbserver/spu-low.c b/gdb/gdbserver/spu-low.c index cb1ac0dc70..867f97bb90 100644 --- a/gdb/gdbserver/spu-low.c +++ b/gdb/gdbserver/spu-low.c @@ -24,7 +24,6 @@ #include #include #include -#include #include #include "filestuff.h" #include "hostio.h" diff --git a/gdb/gdbserver/utils.c b/gdb/gdbserver/utils.c index ec37a9bc1c..b011637c77 100644 --- a/gdb/gdbserver/utils.c +++ b/gdb/gdbserver/utils.c @@ -17,9 +17,6 @@ along with this program. If not, see . */ #include "server.h" -#if HAVE_ERRNO_H -#include -#endif #ifdef IN_PROCESS_AGENT # define PREFIX "ipa: " diff --git a/gdb/gnu-nat.c b/gdb/gnu-nat.c index d6658c7cc9..c8164d60f3 100644 --- a/gdb/gnu-nat.c +++ b/gdb/gnu-nat.c @@ -23,7 +23,6 @@ #include "defs.h" #include -#include #include #include #include diff --git a/gdb/go32-nat.c b/gdb/go32-nat.c index 75596a2356..727f810aa5 100644 --- a/gdb/go32-nat.c +++ b/gdb/go32-nat.c @@ -105,7 +105,6 @@ #include "inf-child.h" #include -#include #include #include #include diff --git a/gdb/i386gnu-nat.c b/gdb/i386gnu-nat.c index 94d2a0a264..8fad87117b 100644 --- a/gdb/i386gnu-nat.c +++ b/gdb/i386gnu-nat.c @@ -22,7 +22,6 @@ #include "floatformat.h" #include "regcache.h" -#include #include #include #include diff --git a/gdb/m2-typeprint.c b/gdb/m2-typeprint.c index 45bc093121..72c107b52b 100644 --- a/gdb/m2-typeprint.c +++ b/gdb/m2-typeprint.c @@ -31,7 +31,6 @@ #include "c-lang.h" #include "typeprint.h" #include "cp-abi.h" -#include static void m2_print_bounds (struct type *type, struct ui_file *stream, int show, int level, diff --git a/gdb/nat/linux-btrace.c b/gdb/nat/linux-btrace.c index 19e218ea71..f6fdbda5a4 100644 --- a/gdb/nat/linux-btrace.c +++ b/gdb/nat/linux-btrace.c @@ -37,7 +37,6 @@ #if HAVE_LINUX_PERF_EVENT_H && defined(SYS_perf_event_open) -#include #include #include #include diff --git a/gdb/p-typeprint.c b/gdb/p-typeprint.c index 6870cdf07f..b1e16f02d3 100644 --- a/gdb/p-typeprint.c +++ b/gdb/p-typeprint.c @@ -31,7 +31,6 @@ #include "p-lang.h" #include "typeprint.h" #include "gdb-demangle.h" -#include #include static void pascal_type_print_varspec_suffix (struct type *, struct ui_file *, diff --git a/gdb/procfs.c b/gdb/procfs.c index d93843ad6d..3465bc5dcf 100644 --- a/gdb/procfs.c +++ b/gdb/procfs.c @@ -42,7 +42,6 @@ #ifdef HAVE_SYS_SYSCALL_H #include #endif -#include #include "gdb_wait.h" #include #include diff --git a/gdb/remote-sim.c b/gdb/remote-sim.c index 51b3c30122..890154836d 100644 --- a/gdb/remote-sim.c +++ b/gdb/remote-sim.c @@ -28,7 +28,6 @@ #include #include #include -#include #include "terminal.h" #include "target.h" #include "gdbcore.h" diff --git a/gdb/rs6000-nat.c b/gdb/rs6000-nat.c index 4ba955c5cc..1b09680f5f 100644 --- a/gdb/rs6000-nat.c +++ b/gdb/rs6000-nat.c @@ -46,7 +46,6 @@ #include #include #include -#include #include #include diff --git a/gdb/target.c b/gdb/target.c index 011eb4a72d..ba244bc8e4 100644 --- a/gdb/target.c +++ b/gdb/target.c @@ -20,7 +20,6 @@ along with this program. If not, see . */ #include "defs.h" -#include #include "target.h" #include "target-dcache.h" #include "gdbcmd.h" diff --git a/gdb/typeprint.c b/gdb/typeprint.c index e0b7c44f50..3d8620aa4d 100644 --- a/gdb/typeprint.c +++ b/gdb/typeprint.c @@ -33,7 +33,6 @@ #include "typeprint.h" #include "exceptions.h" #include "valprint.h" -#include #include #include "cli/cli-utils.h" #include "extension.h" diff --git a/gdb/ui-file.c b/gdb/ui-file.c index 767b55b78a..49607dcc1b 100644 --- a/gdb/ui-file.c +++ b/gdb/ui-file.c @@ -25,8 +25,6 @@ #include "gdb_select.h" #include "filestuff.h" -#include - static ui_file_isatty_ftype null_file_isatty; static ui_file_write_ftype null_file_write; static ui_file_write_ftype null_file_write_async_safe; diff --git a/gdb/valops.c b/gdb/valops.c index 5ef763d8ad..d9ce2f2303 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -36,7 +36,6 @@ #include "cp-support.h" #include "dfp.h" #include "tracepoint.h" -#include #include "observer.h" #include "objfiles.h" #include "exceptions.h" diff --git a/gdb/valprint.c b/gdb/valprint.c index 0ded6b74ac..d3ab2675fc 100644 --- a/gdb/valprint.c +++ b/gdb/valprint.c @@ -37,8 +37,6 @@ #include "charset.h" #include -#include - /* Maximum number of wchars returned from wchar_iterate. */ #define MAX_WCHARS 4 -- 2.34.1