Another problem with my original message! I must have had an itchy posting finger tonight...

Eric L Hathaway wrote:

Apparently, the truncf function was introduced in the C99 standard, and to use such functions in glibc you must define _ISOC99_SOURCE (or _GNU_SOURCE) in order for the functions to be properly declared by <math.h>. See the follow-up messages to the above glibc mailing list posting for more info. I wrote a simple five line C program to test truncf, and indeed it didn't work properly unless I added -D_ISOC99_SOURCE or -D_GNU_SOURCE to the list of arguments to gcc.

I checked that this compilation problem occurs, and the above fix works, on both a machine running Red Hat 7.3 (glibc-2.2.5, gcc-2.96), and another running Red Hat 9 (glibc-2.3.2, gcc-3.2.2).

I should clarify that I tested this fix with my simple five line C program, not with FlightGear itself. I tried to add -D_ISOC99_SOURCE as a compilation flag to FlightGear, and ./configure barfed with an error saying it was unable to detect a usable ul.h and that I need to upgrade plib to 1.6.0 or greater (I'm using the current plib CVS). Removing the flag allowed ./configure to succeed, but compilation fails as before because truncf remains undefined. I will leave this problem for the autoconf/automake wizards out there to resolve.


The other alternative is to not even use glibc's truncf function in the first place. It's only used once in src/Cockpit/panel.cxx, and I see that at the top of that file there is already an inlined definition of truncf for FreeBSD and MSVC. Maybe other platforms could use that definition too?

Regards,
-Eric Hathaway



_______________________________________________
Flightgear-devel mailing list
[EMAIL PROTECTED]
http://mail.flightgear.org/mailman/listinfo/flightgear-devel

Reply via email to