Bug 4060

Summary: frexpf() not found on older Unix'es
Product: Mesa Reporter: Alan Coopersmith <alan.coopersmith>
Component: Mesa coreAssignee: mesa-dev
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: high    
Version: git   
Hardware: SPARC   
OS: Solaris   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 1690    

Description Alan Coopersmith 2005-08-13 04:07:01 UTC
Mesa/src/mesa/tnl/t_vb_arbprogram.c contains this bit of code in do_LOG():

#ifdef _WIN32
   GLfloat mantissa = (GLfloat) frexp((double)tmp, &exponent);
#else
   GLfloat mantissa = frexpf(tmp, &exponent);
#endif

Unfortunately, it's not just Win32 but older Unixes that don't have frexpf().
(It was added in C99 and Unix 2003 standards, but not included in older 
standards.)

For instance, this causes Xorg CVS head builds to fail on Solaris 9 (which only
had C89/Unix 98 compliance), but not Solaris 10 and later (which added C99 &
Unix 2003 compliance).

It would be nice if this #ifdef could be changed instead to 
#ifdef HAVE_FREXPF or something similar that could be set by the build system
(including Imake/autoconf in the Xorg builds which include Mesa).
Comment 1 Brian Paul 2005-08-13 04:56:09 UTC
I've added a FREXPF macro in imports.h to take care of this.
Comment 2 Adam Jackson 2009-08-24 12:23:20 UTC
Mass version move, cvs -> git

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.