Skip to content

Commit f19571a

Browse files
emcconvilledormando
authored andcommitted
Reworked C-alignment check to be clear-as-day.
See bug/pull discussions - http://code.google.com/p/memcached/issues/detail?id=100 - memcached#3 - http://code.google.com/p/memcached/issues/detail?id=360 Conflicts: configure.ac
1 parent 2fa661a commit f19571a

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

configure.ac

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -493,15 +493,18 @@ AC_DEFUN([AC_C_ALIGNMENT],
493493
*ptr = 0x1;
494494
495495
// catch unaligned word access (ARM cpus)
496-
*buf = 1; *(buf +1) = 2; *(buf + 2) = 2; *(buf + 3) = 3; *(buf + 4) = 4;
497-
int* i = (int*)(buf+1);
498-
return (
499496
#ifdef ENDIAN_BIG
500-
0x02030405
497+
#define ALIGNMENT 0x02030405
501498
#else
502-
0x05040302
499+
#define ALIGNMENT 0x05040302
503500
#endif
504-
== *i) ? 0 : 1;
501+
*(buf + 0) = 1;
502+
*(buf + 1) = 2;
503+
*(buf + 2) = 3;
504+
*(buf + 3) = 4;
505+
*(buf + 4) = 5;
506+
int* i = (int*)(buf+1);
507+
return (ALIGNMENT == *i) ? 0 : 1;
505508
])
506509
],[
507510
ac_cv_c_alignment=none

0 commit comments

Comments
 (0)