diff options
author | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-02-23 21:20:52 +0000 |
---|---|---|
committer | levine <levine@ae88bc3d-4319-0410-8dbf-d08b4c9d3795> | 1998-02-23 21:20:52 +0000 |
commit | 81bf2a6dd90060275b14522a1485b0ddd711f9cd (patch) | |
tree | 34e700998e93f359b6c2d7f9b36f0aa41ad7387c | |
parent | cd612eb69f0d33ecc7a273c9f87012e31b2025ab (diff) | |
download | ATCD-81bf2a6dd90060275b14522a1485b0ddd711f9cd.tar.gz |
(declare_entry,setup_entry): use the setup_entry with padding by
default, unless TAO_HAS_FIXED_BYTE_ALIGNMENT is #defined.
-rw-r--r-- | TAO/tao/interp.cpp | 41 |
1 files changed, 21 insertions, 20 deletions
diff --git a/TAO/tao/interp.cpp b/TAO/tao/interp.cpp index 6062e68400d..0a4e570018d 100644 --- a/TAO/tao/interp.cpp +++ b/TAO/tao/interp.cpp @@ -245,32 +245,33 @@ static table_element table [CORBA::TC_KIND_COUNT] = TC_KIND_COUNT }; -#if defined (unix) || defined (VXWORKS) || defined (ACE_WIN32) -#define declare_entry(x,t) \ - struct align_struct_ ## t { \ - x one; \ - char dummy [TAO_ALIGNMENT_MAGIC_NUMBER + 1 - sizeof(x)]; \ - x two; \ - } +#if defined (TAO_HAS_FIXED_BYTE_ALIGNMENT) + // Have a bogus one + #define declare_entry(x,t) struct align_struct_ ## t { } -#define setup_entry(x,t) \ + #define setup_entry(x,t) \ { \ - align_struct_ ## t align; \ - table [t].size = sizeof (x); \ - table [t].alignment = \ - (char *) &align.two - (char *) &align.one - TAO_ALIGNMENT_MAGIC_NUMBER; \ + table [t].size = sizeof (x); \ + table [t].alignment = 1; \ } - -#else // "Fixed" byte alignment -// Have a bogus one -#define declare_entry(x,t) struct align_struct_ ## t { } -#define setup_entry(x,t) \ +#else /* ! TAO_HAS_FIXED_BYTE_ALIGNMENT */ + // unix, ACE_WIN32, VXWORKS, __Lynx__, at least + #define declare_entry(x,t) \ + struct align_struct_ ## t \ { \ - table [t].size = sizeof (x); \ - table [t].alignment = 1; \ + x one; \ + char dummy [TAO_ALIGNMENT_MAGIC_NUMBER + 1 - sizeof(x)]; \ + x two; \ } -#endif /* defined (unix) || defined (VXWORKS) || defined (ACE_WIN32) */ + #define setup_entry(x,t) \ + { \ + align_struct_ ## t align; \ + table [t].size = sizeof (x); \ + table [t].alignment = \ + (char *) &align.two - (char *) &align.one - TAO_ALIGNMENT_MAGIC_NUMBER; \ + } +#endif /* ! TAO_HAS_FIXED_BYTE_ALIGNMENT */ // Fills in fixed size and alignment values. |