[FFmpeg-devel] ffmpeg's alignment troubles
Thu Jan 3 07:37:52 CET 2008
In libavutil's mem.h, there's a macro used to align declarations of
Under linux, this macro works flawlessly. But under mingw32 (gcc
3.4.5), I am finding that it doesn't.
Here's a simple example:
#define DECLARE_ALIGNED(n,t,v) t v __attribute__ ((aligned (n)))
#define DECLARE_ALIGNED_16(t,v) DECLARE_ALIGNED(16,t,v)
DECLARE_ALIGNED_16( int, align4 );
static DECLARE_ALIGNED_16( int, align5 );
#define TEST_ALIGN(x) \
if ( ((long) &(align##x)) & 15 ) \
fprintf( stderr, "align" #x " not aligned %p\n", &align##x );
When I cross-compile it on my AMD64 box, I get:
$ i586-mingw32msvc-g++ -o main.exe main.c
$ wine main.exe
align4 not aligned 006AFEB4
align5 not aligned 00404038
This is somewhat problematic in ffmpeg, as dsputil, for example, has
many such declarations. I've also tried compiling it with a native
mingw with similar results.
I was wondering if this is something you were aware of (or it is
something obvious I am doing wrong).
I'm trying to trace a problem with a mingw32 compiled ffmpeg and this is
one issue that has certainly cropped.
ggarra at advancedsl.com.ar
AMD4400 - ASUS48N-E
More information about the ffmpeg-devel