aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorBjörn-Egil Dahlberg <[email protected]>2011-06-29 16:21:30 +0200
committerBjörn-Egil Dahlberg <[email protected]>2011-06-29 16:21:30 +0200
commitf24cff95a791e6798bd72e74d3967c962e1c9094 (patch)
treeb2272e823d1334ec8e36f4c15e1ef08b98b27ccc
parent751ec4f918bed2f5455538e6296c6b925bcca002 (diff)
downloadotp-f24cff95a791e6798bd72e74d3967c962e1c9094.tar.gz
otp-f24cff95a791e6798bd72e74d3967c962e1c9094.tar.bz2
otp-f24cff95a791e6798bd72e74d3967c962e1c9094.zip
Align ei buffer according to size of pointers
-rw-r--r--lib/erl_interface/src/connect/ei_resolve.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/erl_interface/src/connect/ei_resolve.c b/lib/erl_interface/src/connect/ei_resolve.c
index 50c5a4161d..ba8f8fbce3 100644
--- a/lib/erl_interface/src/connect/ei_resolve.c
+++ b/lib/erl_interface/src/connect/ei_resolve.c
@@ -185,7 +185,12 @@ static int verify_dns_configuration(void)
* align: increment buf until it is dword-aligned, reduce len by same amount.
* advance: increment buf by n bytes, reduce len by same amount .
*/
-#define align_buf(buf,len) for (;(((unsigned)buf)&0x3); (buf)++, len--)
+#if defined SIZEOF_VOID_P
+#define ALIGNBYTES (SIZEOF_VOID_P - 1)
+#else
+#define ALIGNBYTES (sizeof(void*) - 1)
+#endif
+#define align_buf(buf,len) for (;(((unsigned)buf) & ALIGNBYTES); (buf)++, len--)
#define advance_buf(buf,len,n) ((buf)+=(n),(len)-=(n))
/* "and now the tricky part..." */