aboutsummaryrefslogtreecommitdiff
path: root/m4/align.m4
diff options
context:
space:
mode:
authorNils Durner <durner@gnunet.org>2009-05-29 19:20:23 +0000
committerNils Durner <durner@gnunet.org>2009-05-29 19:20:23 +0000
commit179946965cc0f171e4af1bd053b42ec36314c86e (patch)
treedf49518ea91d8a644ecbd0e6a48c26c1e7fe93b3 /m4/align.m4
parentc137702c332798fb68622739f61ae06bbf6286df (diff)
downloadgnunet-179946965cc0f171e4af1bd053b42ec36314c86e.tar.gz
gnunet-179946965cc0f171e4af1bd053b42ec36314c86e.zip
cp
Diffstat (limited to 'm4/align.m4')
-rw-r--r--m4/align.m428
1 files changed, 28 insertions, 0 deletions
diff --git a/m4/align.m4 b/m4/align.m4
new file mode 100644
index 000000000..256300e37
--- /dev/null
+++ b/m4/align.m4
@@ -0,0 +1,28 @@
1# align.m4
2dnl Copyright (C) 2008 Christian Grothoff
3dnl This file is free software, distributed under the terms of the GNU
4dnl General Public License. As a special exception to the GNU General
5dnl Public License, this file may be distributed as part of a program
6dnl that contains a configuration script generated by Autoconf, under
7dnl the same distribution terms as the rest of that program.
8
9# Define HAVE_UNALIGNED_64_ACCESS if reading a 64-bit value at a 32-bit aligned offset works
10# Note that the program intentionally causes a SIGBUS (so you may
11# see some message along those lines on the console).
12AC_DEFUN([AC_UNALIGNED_64_ACCESS],
13[AC_CACHE_CHECK([whether unaligned 64-bit access works],
14 ac_cv_unaligned_64_access,
15 [
16 AC_RUN_IFELSE(AC_LANG_PROGRAM([[struct S { int a,b,c;};]],
17 [[struct S s = {0,0,0}; long long * p = &s.b;
18 long long x = *p; return (int) x*x;]]),
19 ac_cv_unaligned_64_access=yes,
20 ac_cv_unaligned_64_access=no,
21 ac_cv_unaligned_64_access=no)
22 ])
23 case "$ac_cv_unaligned_64_access" in
24 *yes) value=1;;
25 *) value=0;;
26 esac
27 AC_DEFINE_UNQUOTED([HAVE_UNALIGNED_64_ACCESS], $value, [We can access-64 bit values that are only 32-bit aligned])
28])