[2/3] Do not include config.h directly

Message ID 1406295265-4681-3-git-send-email-gbenson@redhat.com
State Committed
Headers

Commit Message

Gary Benson July 25, 2014, 1:34 p.m. UTC
  All source files under gdb/ that include headers from gdb/ include
either defs.h or server.h before any other code with the exception
of gdb/gdbserver/gdbreplay.c which seems to be a special case.  Both
defs.h and server.h include both our and gnulib's config.h files as
their first non-comment line, so no other file ever needs to directly
include any config.h.  This commit removes two such direct config.h
includes.

gdb/
2014-07-25  Gary Benson  <gbenson@redhat.com>

	* common/common-utils.h: Do not include config.h.
	* nat/linux-btrace.h: Likewise.
---
 gdb/ChangeLog             |    5 +++++
 gdb/common/common-utils.h |    1 -
 gdb/nat/linux-btrace.h    |    1 -
 3 files changed, 5 insertions(+), 2 deletions(-)
  

Comments

Pedro Alves July 29, 2014, 3:03 p.m. UTC | #1
On 07/25/2014 02:34 PM, Gary Benson wrote:
> All source files under gdb/ that include headers from gdb/ include
> either defs.h or server.h before any other code 

> with the exception
> of gdb/gdbserver/gdbreplay.c which seems to be a special case.  

gdbreplay is simply another program that lives in the
gdbserver directory too, for historical reasons.

> Both
> defs.h and server.h include both our and gnulib's config.h files as
> their first non-comment line, so no other file ever needs to directly
> include any config.h.  This commit removes two such direct config.h
> includes.
> 

Looks good.

Thanks,
Pedro Alves
  

Patch

diff --git a/gdb/common/common-utils.h b/gdb/common/common-utils.h
index 063698d..f052fed 100644
--- a/gdb/common/common-utils.h
+++ b/gdb/common/common-utils.h
@@ -20,7 +20,6 @@ 
 #ifndef COMMON_UTILS_H
 #define COMMON_UTILS_H
 
-#include "config.h"
 #include "ansidecl.h"
 #include <stddef.h>
 #include <stdarg.h>
diff --git a/gdb/nat/linux-btrace.h b/gdb/nat/linux-btrace.h
index 12e9b60..a96d9d1 100644
--- a/gdb/nat/linux-btrace.h
+++ b/gdb/nat/linux-btrace.h
@@ -23,7 +23,6 @@ 
 #define LINUX_BTRACE_H
 
 #include "btrace-common.h"
-#include "config.h"
 #include "vec.h"
 #include "ptid.h"
 #include <stddef.h>