This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository legacy-imlib2.

View the commit online.

commit 9222dad42dcc50a931f04cb46bfb11c7c5a5c4db
Author: Kim Woelders <k...@woelders.dk>
AuthorDate: Sat Jan 28 11:04:30 2023 +0100

    autofoo: Add __PACKED__ for optional struct packing
---
 configure.ac     |  2 ++
 m4/ec_packing.m4 | 23 +++++++++++++++++++++++
 2 files changed, 25 insertions(+)

diff --git a/configure.ac b/configure.ac
index 791f44d..2b8b78f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -259,6 +259,7 @@ AM_CONDITIONAL(BUILD_DOC, test "$enable_doc_build" = "yes")
 
 EC_C_WARNINGS()
 EC_C_VISIBILITY(yes)
+EC_C_PACKING()
 EC_C_ASAN()
 
 VERSION_MAJOR=`echo $VERSION | awk -F. '{print $1}'`
@@ -328,6 +329,7 @@ echo
 echo "Include filters...........: $enable_filters"
 echo "Include text functions....: $enable_text"
 echo "Use visibility hiding.....: $enable_visibility_hiding"
+echo "Use struct packing........: $enable_packing"
 echo
 echo "Installation path.........: $prefix"
 echo
diff --git a/m4/ec_packing.m4 b/m4/ec_packing.m4
new file mode 100644
index 0000000..ec9699f
--- /dev/null
+++ b/m4/ec_packing.m4
@@ -0,0 +1,23 @@
+dnl Copyright (C) 2023 Kim Woelders
+dnl This code is public domain and can be freely used or copied.
+
+dnl Macro to define __PACKED__ if supported and --enable-packing is given
+
+dnl Usage: EC_C_PACKING()
+
+AC_DEFUN([EC_C_PACKING], [
+  AC_ARG_ENABLE([packing],
+    [AS_HELP_STRING([--enable-packing],
+                    [enable packing structures for unaligned access @<:@default=no@:>@])],,
+    [enable_packing=no])
+
+  if test "x$enable_packing" = "xyes"; then
+    if test -n "$GCC"; then
+      AC_DEFINE(__PACKED__, __attribute__((packed)), [Use struct packing for unaligned access])
+    else
+      AC_MSG_ERROR([Struct packing was requested but no method is known])
+    fi
+  else
+    AC_DEFINE(__PACKED__, , [Not using struct packing for unaligned access])
+  fi
+])

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to