diff options
author | Niels Möller <nisse@lysator.liu.se> | 2013-04-16 15:38:15 +0200 |
---|---|---|
committer | Niels Möller <nisse@lysator.liu.se> | 2013-04-16 15:38:15 +0200 |
commit | 081483815557570dee6009ae46d66ed43a42c407 (patch) | |
tree | a89311be413620bff1645ac4ded75c2e29bfafa5 /asm.m4 | |
parent | e1646357a32fc37f98c9c54e6cdabee12dd50119 (diff) | |
download | nettle-081483815557570dee6009ae46d66ed43a42c407.tar.gz |
Switch to non-logarithmic ALIGN macro.
Diffstat (limited to 'asm.m4')
-rw-r--r-- | asm.m4 | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -26,16 +26,17 @@ define(<EPILOGUE>, <ifelse(ELF_STYLE,yes, <.size C_NAME($1), . - C_NAME($1)>,<>)>) -dnl Argument to ALIGN is always logarithmic -dnl FIXME: the << operator is not supported by Solaris m4, -dnl and ** is not supported by OpenBSD m4. -dnl We should switch to non-logarithmic ALIGN instead. +define(<m4_log2>, <m4_log2_internal($1,1,0)>) +define(<m4_log2_internal>, +<ifelse($3, 10, <not-a-power-of-two>, +$1, $2, $3, +<m4_log2_internal($1, eval(2*$2), eval(1 + $3))>)>) + +dnl Argument to ALIGN is always in bytes, and converted to a +dnl logarithmic .align if necessary. -dnl Need changequote to be able to use the << operator. define(<ALIGN>, -<changequote([,])dnl -.align ifelse(ALIGN_LOG,yes,$1,eval(1 << $1))dnl >> balance -changequote(<,>)dnl +<.align ifelse(ALIGN_LOG,yes,<m4_log2($1)>,$1) >) dnl Struct defining macros |