From: M. L. <meh...@co...> - 2002-10-31 16:03:17
|
Hi Brain I am glade at last someone got your attention!!!!! When it comes to HPUX platforms finite(x) and isfinite(x) is been a bug for long long time. I 've send you email with patch every time the new vesion of Mesa was out!!. I 've been porting Mesa for the HPUX Archive for long time now. I hope to see some change in future release of Mesa. Thanks __Mehdi > > Rouben Rostamian wrote: > > Brian, re your message: > > > > > >>In src/mmath.h, try replacing > >> > >>#define IS_INF_OR_NAN(x) (!finite(x)) > >> > >>with: > >> > >>#define IS_INF_OR_NAN(x) (!isfinite(x)) > >> > >> > >>The later function is stancard in C99. Could you or anyone else using > >>HPUX look at the system headers (and math.h in particular) to see if > >>_ISOC99_SOURCE is used? Looking at RH Linux headers, I think that might > >>be the symbol to test to do this: > >> > >>#ifdef _ISOC99_SOURCE > >>#define IS_INF_OR_NAN(x) (!isfinite(x)) > >>#else > >>#define IS_INF_OR_NAN(x) (!finite(x)) > >>#endif > > > > > > I don't know about HPUX, but Section 6.10.8 of the C99 standard has > > an explicit list of predefined macros: > > > > 6.10.8 Predefined macro names > > > > The following names shall be defined by the implementation: > > > > __LINE__ [description snipped] > > __FILE__ [description snipped] > > ... > > __STDC_VERSION__ The decimal constant 199901L (footnote) > > > > (footnote) This macro was not specified in ISO/IEC 9899-1990 > > and was specified as 199409L in ISO/IEC 9899/AMD1:1995. > > > > Therefore it appears that a portable test would be > > something like the following: > > > > #if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L > > #define IS_INF_OR_NAN(x) (!isfinite(x)) > > #else > > #define IS_INF_OR_NAN(x) (!finite(x)) > > #endif > > > > Aurelio wrote: > > > I could find no _ISOC99_SOURCE nor __STDC_VERSION__ > > any where under /usr/include. > > > > /usr/include/math.h contains: > > > > /******** HPUX EXTENSIONS *************************************/ > > > > #ifdef _INCLUDE_HPUX_SOURCE > > . > > . > > # define isfinite(x) _ISFINITE(x) > > . > > . > > #endif /* _INCLUDE_HPUX_SOURCE */ > > > In light of these two replies, maybe this would do it: > > > #if defined(isfinite) > #define IS_INF_OR_NAN(x) (!isfinite(x)) > #elif defined(finite) > #define IS_INF_OR_NAN(x) (!finite(x)) > #elif defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L > #define IS_INF_OR_NAN(x) (!isfinite(x)) > #else > #define IS_INF_OR_NAN(x) (!finite(x)) > #endif > > > -Brian > > > > ------------------------------------------------------- > This sf.net email is sponsored by: Influence the future > of Java(TM) technology. Join the Java Community > Process(SM) (JCP(SM)) program now. > http://ads.sourceforge.net/cgi-bin/redirect.pl?sunm0004en > _______________________________________________ > Mesa3d-users mailing list > Mes...@li... > https://lists.sourceforge.net/lists/listinfo/mesa3d-users > |