[osg-users] Please test SVN version of OpenSceneGraph

Brian Keener brianklistacct at alltel.net
Thu Sep 27 15:16:30 PDT 2007


Robert Osfield wrote:
> The errors don't make any sense to me, the line is:
> 
> 
> inline float log2(float v) { return logf(v) * static_cast<float>(INVLN_2); 
}
> 
> And the error you get is:
> 
> /usr/src/OpenSceneGraph/include/osg/Math:197: error: expected `)'
> before '/' token
> /usr/src/OpenSceneGraph/include/osg/Math:197: error: expected `,' or
> `;' before '/' token
> 
> It's like the compiler is treating the definition of INVLN_2 as a
> macro not a const double.  The definition of INVLN_2 is near the top
> of include/osg/Math :
> 
> const double LN_2 = 0.69314718055994530942;
> const double INVLN_2 = 1.0 / LN_2;
> 
> This really looks like a bug in the compiler.  Perhaps changing the
> above be a hardwired value i.e. const double INVLN_2 = 1.442...  might
> get around this bug, could you try this?
> 
> Robert.

I tried the change you suggested but no go.  I think it might be deeper in 
/usr/include/math.h where they do a define on log2 and log2f as follows 
but....

#define log2(x) (log(x) / M_LOG2_E)
#define log2f(x) (logf(x) / (float) M_LOG2_E)

not sure.

bk






More information about the osg-users mailing list