encoding.c (STRUCTURE_SIZE_BOUNDARY): Redefine in a way that determines the value...
authorRichard Earnshaw <rearnsha@arm.com>
Thu, 11 Jan 2001 14:01:45 +0000 (14:01 +0000)
committerRichard Earnshaw <rearnsha@gcc.gnu.org>
Thu, 11 Jan 2001 14:01:45 +0000 (14:01 +0000)
* encoding.c (STRUCTURE_SIZE_BOUNDARY): Redefine in a way that
determines the value dynamically.

From-SVN: r38906

libobjc/ChangeLog
libobjc/encoding.c

index 32fe0a282c34b0ff88a00bad08b787c1b2aa4d32..c937f67d7e142986f85be72e6fbf092dbd894900 100644 (file)
@@ -1,3 +1,8 @@
+2000-01-11  Richard Earnshaw  <rearnsha@arm.com>
+
+       * encoding.c (STRUCTURE_SIZE_BOUNDARY): Redefine in a way that
+       determines the value dynamically.
+
 Wed Jan  3 00:49:10 2001  Ovidiu Predescu  <ovidiu@cup.hp.com>
 
        * sendmsg.c: Added __objc_msg_forward, a hook that allows external
index ea60b7b3c5849dbcba293dd8ca8f4249da245e5f..bbbb81cdb8b5e38d35b7f4006348001f224c67ab 100644 (file)
@@ -62,6 +62,11 @@ Boston, MA 02111-1307, USA.  */
 
 #define get_inner_array_type(TYPE)      ((TYPE) + 1)
 
+/* Some ports (eg ARM) allow the structure size boundary to be
+   selected at compile-time.  We override the normal definition with
+   one that has a constant value for this compilation.  */
+#undef STRUCTURE_SIZE_BOUNDARY
+#define STRUCTURE_SIZE_BOUNDARY (BITS_PER_UNIT * sizeof (struct{char a;}))
 
 static inline int
 atoi (const char* str)
@@ -724,9 +729,7 @@ objc_layout_structure (const char *type,
   layout->record_size = 0;
   layout->record_align = BITS_PER_UNIT;
 
-#ifdef STRUCTURE_SIZE_BOUNDARY
   layout->record_align = MAX (layout->record_align, STRUCTURE_SIZE_BOUNDARY);
-#endif
 }