This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Add ATTRIBUTE_PACKED to ansidecl.h


Hi Guys,

  I am applying the patch below to add a definition of
  ATTRIBUTE_PACKED to ansidecl.h along the lines of the other
  attributes defined in this file.  This definition is now needed by
  the binutils sources.

  Does anyone know when the packed attribute was actually introduced
  into gcc ?  I have not put a version number check into the patch
  because as far as I could tell it came in when support for
  __attribute__ was added.

Cheers
  Nick

include/ChangeLog
2006-12-06  Nick Clifton  <nickc@redhat.com>

	* ansidecl.h (ATTRIBUTE_PACKED): Define.
  
Index: include/ansidecl.h
===================================================================
--- include/ansidecl.h	(revision 119579)
+++ include/ansidecl.h	(working copy)
@@ -361,6 +361,12 @@ So instead we use the macro below and te
 # endif /* GNUC >= 3.0 */
 #endif /* ATTRIBUTE_ALIGNED_ALIGNOF */
 
+/* Useful for structures whoes layout must much some binary specification
+   regardless of the alignment and padding qualities of the compiler.  */
+#ifndef ATTRIBUTE_PACKED
+# define ATTRIBUTE_PACKED __attribute__ ((packed))
+#endif
+
 /* We use __extension__ in some places to suppress -pedantic warnings
    about GCC extensions.  This feature didn't work properly before
    gcc 2.8.  */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]