On 2012-12-16 14:46:54 -0800, Ronald S. Bultje wrote:
> Hi,
> 
> On Sun, Dec 16, 2012 at 1:49 PM, Janne Grunau <[email protected]> wrote:
> > On 2012-12-16 12:36:56 -0800, Ronald S. Bultje wrote:
> >>
> >> On Sun, Dec 16, 2012 at 5:52 AM, Janne Grunau <[email protected]> 
> >> wrote:
> >> >
> >> > Nasm also fails on '%1 %+ SUFFIX' with empty SUFFIX in cpuid.asm. It was
> >> > previously working since it was always followed by ', %2'. Easiest
> >> > solution I've found was adding parameters to cpu_cpuid_test in
> >> > cpuid.asm.
> >>
> >> Does it work if you add a comma behind it (but no arguments)? Or does
> >> cglobal_internal then think %0 == 2?
> >
> > It already failes earlier with:
> > libavutil/x86/cpuid.asm:70: error: (cglobal_internal:1) `%ifndef'
> > expects macro identifiers
> >
> > presumeably failing on cglobaled_cpu_cpuid_test,
> >
> > Adding a unused parameter to both cglobal_internal calls works ugly
> > as it is.
> 
> The old one used this:
> 
> diff --git a/libavutil/x86/x86inc.asm b/libavutil/x86/x86inc.asm
> index 483ae7b..564ba50 100644
> --- a/libavutil/x86/x86inc.asm
> +++ b/libavutil/x86/x86inc.asm
> @@ -614,12 +614,8 @@ DECLARE_ARG 7, 8, 9, 10, 11, 12, 13, 14
>  ; Applies any symbol mangling needed for C linkage, and sets up a define 
> such t
>  ; subsequent uses of the function name automatically refer to the mangled 
> versi
>  ; 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
> -%else
> +%macro cglobal 1-2+ "" ; name, [PROLOGUE args]
>      cglobal_internal %1 %+ SUFFIX, %2
> -%endif
>  %endmacro
>  %macro cglobal_internal 1-2+
>      %ifndef cglobaled_%1
> @@ -640,7 +636,7 @@ DECLARE_ARG 7, 8, 9, 10, 11, 12, 13, 14
>      %assign stack_offset 0
>      %assign stack_size 0
>      %assign stack_size_padded 0
> -    %if %0 > 1
> +    %ifnidn %2, ""
>          PROLOGUE %2
>      %endif
>  %endmacro
> 
> Does that work?

yes

Janne
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel

Reply via email to