[MPlayer-dev-eng] about log2 replacement

Uoti Urpala uoti.urpala at pp1.inet.fi
Mon Aug 10 08:25:31 CEST 2009


On Mon, 2009-08-10 at 14:01 +0800, Chang Chen wrote:
> I use cygwin, here are log2 checking algorithm from configure
> 
>   #include<math.h>
> 
>   int  main (void)
>   { 
>     long(*foo)(float);
>     foo = log2;
>     Void(*foo)(0.0);
>     return 0.0;
>   }
> 
> Since log2 is defined as a macro, HAVE_LOG2 is 0.

How does this fail? Is log2 ONLY defined as a macro? Having a
function-like macro definition _in addition_ to a function prototype
shouldn't make it fail, since function-like macro substitution would not
trigger without a left parenthesis after the name, and so the function
would be used. If there's only a macro definition without a function
prototype then the cygwin headers are buggy (the standard requires there
to be an actual function, having an additional macro definition is
optional).





More information about the MPlayer-dev-eng mailing list