summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorEric McConville <emcconville@emcconville.com>2014-04-17 15:57:49 -0500
committerdormando <dormando@rydia.net>2014-04-27 23:21:05 -0700
commitf19571abcf0aadb169d6aa655df6b20272ef766b (patch)
treed621318cb6767e7373f2f34b7560496ee700d322 /configure.ac
parent2fa661a77ff5712aad7e5b996b3bbc3636ef92b6 (diff)
downloadmemcached-f19571abcf0aadb169d6aa655df6b20272ef766b.tar.gz
Reworked C-alignment check to be clear-as-day.
See bug/pull discussions - http://code.google.com/p/memcached/issues/detail?id=100 - https://github.com/memcached/memcached/pull/3 - http://code.google.com/p/memcached/issues/detail?id=360 Conflicts: configure.ac
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac15
1 files changed, 9 insertions, 6 deletions
diff --git a/configure.ac b/configure.ac
index 0f602cb..6454a16 100644
--- a/configure.ac
+++ b/configure.ac
@@ -493,15 +493,18 @@ AC_DEFUN([AC_C_ALIGNMENT],
*ptr = 0x1;
// catch unaligned word access (ARM cpus)
- *buf = 1; *(buf +1) = 2; *(buf + 2) = 2; *(buf + 3) = 3; *(buf + 4) = 4;
- int* i = (int*)(buf+1);
- return (
#ifdef ENDIAN_BIG
- 0x02030405
+#define ALIGNMENT 0x02030405
#else
- 0x05040302
+#define ALIGNMENT 0x05040302
#endif
- == *i) ? 0 : 1;
+ *(buf + 0) = 1;
+ *(buf + 1) = 2;
+ *(buf + 2) = 3;
+ *(buf + 3) = 4;
+ *(buf + 4) = 5;
+ int* i = (int*)(buf+1);
+ return (ALIGNMENT == *i) ? 0 : 1;
])
],[
ac_cv_c_alignment=none