[MPlayer-dev-eng] need swscale.c -> swscale_template.c move/copy

Michael Niedermayer michaelni at gmx.at
Tue Nov 27 13:19:10 CET 2001


Hi

On Tuesday 27 November 2001 10:49, pl wrote:
[...]
>
> [...]
>
> A cleanier way imho, since it limits #defines, in pseudo C:
>
> #if RUNTIME_CPUDETECT
>   int gCpuInfo_hasmmx;
> #else
>   #define gCpuInfo_hasmmx HAVE_MMX
> (or const int ... = HAVE_MMX;)
> #endif
>
>
> main() {
> #if RUNTIME_CPUDETECT
>   printf("you'll get faster/smaller/nicer binaries by running configure
> ..."); gCpuInfo_hasmmx=gCpuInfo_hasmmx();
>   ...
> #endif
> }
>
> if(gCpuInfo_hasmmx) {
>  blah();
> }
>
> gcc won't generate the test if there's a 'if (1)' or 'if (0)'.
[...]

that might be problematic because these functions (blah_MMX2() for example on 
an MMX CPU) wont even get compiled and if gcc does not optimize it away, it 
should die during linking ... we could create dummy functions within ifdefs 
to avoid that but that would look equally ugly imho :(

Michael



More information about the MPlayer-dev-eng mailing list