[COMMIT/RFC] Always include <sys/types.h> from defs.h

Mark Kettenis mark.kettenis@xs4all.nl
Mon May 9 19:44:00 GMT 2005


Including <sys/types.h> is a prerequisite to including many of the
other <sys/...> header files on BSD-derived systems.  Since it isn't
the case on Linux, evry now and then the build is broken when someone
developing on Linux adds <sys/whetever.h>.  This patch prevents this
from happening ever again.

Committed as obvious, since this is what bfd/sysdep.h and
opcodes/sysdep.h already do.  Makes GDB build on vax-dec-ultrix4.0
again ;-).

Raises the question whether we should move towards eliminating
<sys/types.h> from all other GDB source files.  What do folks think
about that?

Mark


Index: ChangeLog
from  Mark Kettenis  <kettenis@gnu.org>

	* defs.h: Unconditionally include <sys/types.h>.

Index: defs.h
===================================================================
RCS file: /cvs/src/src/gdb/defs.h,v
retrieving revision 1.184
diff -u -p -r1.184 defs.h
--- defs.h 8 May 2005 14:57:41 -0000 1.184
+++ defs.h 9 May 2005 17:19:26 -0000
@@ -26,14 +26,13 @@
 
 #include "config.h"		/* Generated by configure.  */
 
+#include <sys/types.h>
 #include <stdio.h>
 #include <errno.h>		/* System call error return status.  */
 #include <limits.h>
 
 #ifdef HAVE_STDDEF_H
 #include <stddef.h>
-#else
-#include <sys/types.h>		/* For size_t.  */
 #endif
 
 #ifdef HAVE_UNISTD_H



More information about the Gdb-patches mailing list