From: Mans Rullgard <[email protected]>
It appears that something goes wrong in old nasm versions when the
%+ operator is used in the last argument of a macro invocation and
this argument is tested with %ifdef within the macro. Adding a
dummy argument somehow fixes this.
---
Slightly prettier version that avoids a macro indirection by adding
the dummy argument to all cglobal_internal invocations.
libavutil/x86/x86inc.asm | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm
index e729924..b703791 100644
--- a/libavutil/x86/x86inc.asm
+++ b/libavutil/x86/x86inc.asm
@@ -507,12 +507,12 @@ DECLARE_ARG 7, 8, 9, 10, 11, 12, 13, 14
; Appends cpuflags to the function name if cpuflags has been specified.
%macro cglobal 1-2+ ; name, [PROLOGUE args]
%if %0 == 1
- cglobal_internal %1 %+ SUFFIX
+ cglobal_internal %1 %+ SUFFIX, nasm_is_stupid
%else
- cglobal_internal %1 %+ SUFFIX, %2
+ cglobal_internal %1 %+ SUFFIX, nasm_is_stupid, %2
%endif
%endmacro
-%macro cglobal_internal 1-2+
+%macro cglobal_internal 2-3+
%ifndef cglobaled_%1
%xdefine %1 mangle(program_name %+ _ %+ %1)
%xdefine %1.skip_prologue %1 %+ .skip_prologue
@@ -528,8 +528,8 @@ DECLARE_ARG 7, 8, 9, 10, 11, 12, 13, 14
%1:
RESET_MM_PERMUTATION ; not really needed, but makes disassembly somewhat
nicer
%assign stack_offset 0
- %if %0 > 1
- PROLOGUE %2
+ %if %0 > 2
+ PROLOGUE %3
%endif
%endmacro
@@ -795,9 +795,9 @@ INIT_XMM
; Append cpuflags to the callee's name iff the appended name is known and the
plain name isn't
%macro call 1
- call_internal %1, %1 %+ SUFFIX
+ call_internal %1, %1 %+ SUFFIX, nasm_is_stupid
%endmacro
-%macro call_internal 2
+%macro call_internal 3
%xdefine %%i %1
%ifndef cglobaled_%1
%ifdef cglobaled_%2
--
1.7.1
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel