This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "DotGNU Portable.NET engine, compilers and tools (pnet)".

The branch, master has been updated
       via  6d9f56bc2e4b3764b14e720fca69b3b62f635e1f (commit)
      from  607bd8a13b861964871b8e9bdcf5d27e765ced06 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.savannah.gnu.org/cgit/pnet.git/commit/?id=6d9f56bc2e4b3764b14e720fca69b3b62f635e1f

commit 6d9f56bc2e4b3764b14e720fca69b3b62f635e1f
Author: Klaus Treichel <[email protected]>
Date:   Wed Jan 5 15:41:12 2011 +0100

    Use offsetof to determine the alignment of the      types if available in
    il_align.h.

diff --git a/ChangeLog b/ChangeLog
index 88330a3..d6cbb2f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -7,6 +7,9 @@
        * engine/amd64_codegen.h (amd64_alu_reg_imm_size): Replace check for
        reg == X86_EAX with reg == AMD64_RAX.
 
+       * include/il_align.h: Use offsetof to determine the alignment of the
+       types if available.
+
 2011-01-04  Klaus Treichel  <[email protected]>
 
        * engine/cvm.c: Make the interpreter loop variables volatile again
diff --git a/include/il_align.h b/include/il_align.h
index dd128a2..5bfe61e 100644
--- a/include/il_align.h
+++ b/include/il_align.h
@@ -22,6 +22,9 @@
 #define        _IL_ALIGN_H
 
 #include "il_values.h"
+#ifdef HAVE_STDDEF_H
+#include <stddef.h>
+#endif
 
 #ifdef __cplusplus
 extern "C" {
@@ -30,7 +33,8 @@ extern        "C" {
 /*
  * The following is some macro magic that attempts to detect
  * the best alignment to use on the target platform.  The final
- * value, "IL_BEST_ALIGNMENT", will be a compile-time constant.
+ * value, "IL_BEST_ALIGNMENT", will be a compile-time constant if
+ * the offsetof macro is available.
  */
 
 #define        _IL_ALIGN_CHECK_TYPE(type,name) \
@@ -39,8 +43,13 @@ extern       "C" {
                type field; \
        }
 
+#ifdef offsetof
+#define _IL_ALIGN_FOR_TYPE(name)       \
+       (offsetof(struct _IL_align_##name, field))
+#else
 #define        _IL_ALIGN_FOR_TYPE(name)        \
        ((ILNativeUInt)(&(((struct _IL_align_##name *)0)->field)))
+#endif
 
 #define        _IL_ALIGN_MAX(a,b)      \
        ((a) > (b) ? (a) : (b))

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog          |    3 +++
 include/il_align.h |   11 ++++++++++-
 2 files changed, 13 insertions(+), 1 deletions(-)


hooks/post-receive
-- 
DotGNU Portable.NET engine, compilers and tools (pnet)

_______________________________________________
dotgnu-pnet-commits mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/dotgnu-pnet-commits

Reply via email to