[FFmpeg-devel] [PATCH] Compiler macro fix (resend)

Måns Rullgård mans
Wed Feb 20 22:39:08 CET 2008


"Eddie Pang" <eddpang at gmail.com> writes:

> Hello.
>
> The attached patch corrects the compiler macros in libavutil/mem.h
> that were introduced in r11917.
>
> --
> Regards,
> Eddie
>
> Index: libavutil/mem.h
> ===================================================================
> --- libavutil/mem.h	(revision 12157)
> +++ libavutil/mem.h	(working copy)
> @@ -29,10 +29,10 @@
>  #ifdef __ICC
>    #define DECLARE_ALIGNED(n,t,v)       t v __attribute__ ((aligned (n)))
>    #define DECLARE_ASM_CONST(n,t,v)     const t __attribute__ ((aligned (n))) v
> -#elif __GNUC__
> +#elif defined(__GNUC__)
>    #define DECLARE_ALIGNED(n,t,v)       t v __attribute__ ((aligned (n)))
>    #define DECLARE_ASM_CONST(n,t,v)     static const t v attribute_used __attribute__ ((aligned (n)))
> -#elif _MSVC
> +#elif defined(_MSVC)
>    #define DECLARE_ALIGNED(n,t,v)      __declspec(align(n)) t v
>    #define DECLARE_ASM_CONST(n,t,v)    __declspec(align(n)) static const t v
>  #else

Both ways are correct.  Any undefined identifiers in a preprocessor
conditional are replaced by 0, unless subject to the 'defined'
operator.

I'm not opposing the patch, though.

-- 
M?ns Rullg?rd
mans at mansr.com




More information about the ffmpeg-devel mailing list