[FFmpeg-cvslog] r11889 - trunk/libavutil/mem.h
Rich Felker
dalias
Mon Feb 11 18:51:08 CET 2008
On Mon, Feb 11, 2008 at 11:45:38AM +0100, Reimar D?ffinger wrote:
> On Mon, Feb 11, 2008 at 08:57:07AM +0100, Diego Biurrun wrote:
> > On Sun, Feb 10, 2008 at 11:15:18PM +0100, Reimar D?ffinger wrote:
> > > I'd still suggest something along the lines
> > >
> > > #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 HAVE_DECLSPEC
> > > #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
> > > #elif HAVE_GENERIC_C
> > > #define DECLARE_ALIGNED(n,t,v) t v
> > > #define DECLARE_ASM_CONST(n,t,v) static const t v
> > > #else
> > > #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)))
> > > #endif
> > >
> > > Where HAVE_GENERIC_C would/should only be used for a compile without any
> > > asm at all (I don't mind if you leave that section out completely, I
> > > just think it would be better to have. I would not like to have this
> > > case the default though, since it could create hard-to-debug problems
> > > while gaining little if anything in terms of supported compilers).
> >
> > Unfortunately nobody has stepped up to add this sort of proper
> > __declspec/MSVC support, so I vote against keeping it in the
> > default/fallback case.
>
> Huh? With my suggestion the gcc variant is the fallback case...
The fallback case needs to be C, not "GNU C" or "MS Visual C++" or
whatever they call it now. A plain C build has no need for alignment
beyond what the compiler provides, nor any need for asm constants
since there's no asm.
Rich
More information about the ffmpeg-cvslog
mailing list