summaryrefslogtreecommitdiff
path: root/ext/dl/dl.h
diff options
context:
space:
mode:
Diffstat (limited to 'ext/dl/dl.h')
-rw-r--r--ext/dl/dl.h5
1 files changed, 2 insertions, 3 deletions
diff --git a/ext/dl/dl.h b/ext/dl/dl.h
index 90e2131ee2..d0a461f921 100644
--- a/ext/dl/dl.h
+++ b/ext/dl/dl.h
@@ -155,9 +155,8 @@ typedef struct { char c; LONG_LONG x; } s_long_long;
#define ALIGN_FLOAT (sizeof(s_float) - sizeof(float))
#define ALIGN_DOUBLE (sizeof(s_double) - sizeof(double))
-#define DLALIGN(ptr,offset,align) {\
- while( (((unsigned long)((char *)(ptr) + (offset))) % (align)) != 0 ) (offset)++;\
-}
+#define DLALIGN(ptr,offset,align) \
+ ((offset) += ((align) - ((uintptr_t)((char *)(ptr) + (offset))) % (align)) % (align))
#define DLTYPE_VOID 0