Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Reworked C-alignment check to be clear-as-day.

  • Loading branch information...
commit f19571abcf0aadb169d6aa655df6b20272ef766b 1 parent 2fa661a
@emcconville emcconville authored dormando committed
Showing with 9 additions and 6 deletions.
  1. +9 −6 configure.ac
View
15 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
Please sign in to comment.
Something went wrong with that request. Please try again.