[FFmpeg-cvslog] r11889 - trunk/libavutil/mem.h

Diego Biurrun diego
Sun Feb 10 22:16:10 CET 2008


On Sun, Feb 10, 2008 at 10:11:52PM +0100, Diego Biurrun wrote:
> On Sat, Feb 09, 2008 at 09:47:11PM +0100, cehoyos wrote:
> > 
> > Log:
> > Allow compilation with icc 10.1.
> > 
> > --- trunk/libavutil/mem.h	(original)
> > +++ trunk/libavutil/mem.h	Sat Feb  9 21:47:11 2008
> > @@ -28,7 +28,11 @@
> >  
> >  #ifdef __GNUC__
> >    #define DECLARE_ALIGNED(n,t,v)       t v __attribute__ ((aligned (n)))
> > +#ifdef __ICC
> > +  #define DECLARE_ASM_CONST(n,t,v)     const t __attribute__ ((aligned (n))) v
> > +#else
> >    #define DECLARE_ASM_CONST(n,t,v)     static const t v attribute_used __attribute__ ((aligned (n)))
> > +#endif
> >  #else
> >    #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
> 
> Wait, icc defines __GNUC__?!?

I suggest the following, which is farm more readable IMO even if -
strictly speaking - it duplicates one line:

#ifdef __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 __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
#else
  #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
#endif

Diego




More information about the ffmpeg-cvslog mailing list