<div dir="ltr">Are there any existing macro's that determine if the platform has alignment resolution issues?</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Feb 3, 2018 at 8:21 PM, Valentin V. Bartenev <span dir="ltr"><<a href="mailto:vbart@nginx.com" target="_blank">vbart@nginx.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">On Saturday, 3 February 2018 19:39:55 MSK Matthew Marangoni wrote:<br>
> # HG changeset patch<br>
> # User Matthew Marangoni <<a href="mailto:matthew.marangoni@gmail.com">matthew.marangoni@gmail.com</a>><br>
> # Date 1517675878 28800<br>
> # Sat Feb 03 08:37:58 2018 -0800<br>
> # Node ID 4fe15c57e1d5c7fa4e2daa365f82fd<wbr>00d0a1f6f4<br>
> # Parent e84b174c99ca39155e80dbb7458181<wbr>e20190b70b<br>
> Updated __ORDER_LITTLE_ENDIAN__ to match NGX standards and changed to uint32_t data type<br>
><br>
> diff -r e84b174c99ca -r 4fe15c57e1d5 src/core/ngx_murmurhash.c<br>
> --- a/src/core/ngx_murmurhash.c Mon Jan 22 13:15:25 2018 -0800<br>
> +++ b/src/core/ngx_murmurhash.c Sat Feb 03 08:37:58 2018 -0800<br>
> @@ -16,8 +16,8 @@<br>
> h = 0 ^ len;<br>
><br>
> while (len >= 4) {<br>
> -#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__<br>
> - k = *(u_int32_t*)data;<br>
> +#if (NGX_HAVE_LITTLE_ENDIAN)<br>
> + k = *(uint32_t*)data;<br>
> #else<br>
> k = data[0];<br>
> k |= data[1] << 8;<br>
<br>
<br>
</div></div>Your patch will break nginx on platforms that have alignment requirements.<br>
<br>
wbr, Valentin V. Bartenev<br>
______________________________<wbr>_________________<br>
nginx-devel mailing list<br>
<a href="mailto:nginx-devel@nginx.org">nginx-devel@nginx.org</a><br>
<a href="http://mailman.nginx.org/mailman/listinfo/nginx-devel" rel="noreferrer" target="_blank">http://mailman.nginx.org/<wbr>mailman/listinfo/nginx-devel</a><br>
</blockquote></div><br></div>