[PATCH] Fix packed attribute check for Windows targets

Jussi Kivilinna jussi.kivilinna at iki.fi
Fri May 1 18:09:25 CEST 2015


* configure.ac (gcry_cv_gcc_attribute_packed): Move 'long b' to its
own packed structure.
--

Change packed attribute test so that it works with both MS ABI and SYSV ABI.

Signed-off-by: Jussi Kivilinna <jussi.kivilinna at iki.fi>
---
 configure.ac |    4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 16f6a21..555ad1e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -964,7 +964,9 @@ AC_CACHE_CHECK([whether the GCC style packed attribute is supported],
        [gcry_cv_gcc_attribute_packed],
        [gcry_cv_gcc_attribute_packed=no
         AC_COMPILE_IFELSE([AC_LANG_SOURCE(
-          [[struct foo_s { char a; long b; } __attribute__ ((packed));
+          [[struct foolong_s { long b; } __attribute__ ((packed));
+            struct foo_s { char a; struct foolong_s b; }
+              __attribute__ ((packed));
             enum bar {
               FOO = 1 / (sizeof(struct foo_s) == (sizeof(char) + sizeof(long))),
             };]])],




More information about the Gcrypt-devel mailing list