Re: Problem compiling code in freeBSD 4,9 strtof related.

2004-03-28 Thread Malcolm Kay
On Saturday 27 March 2004 16:29, Eric De la Cruz Lugo wrote:
 Hi, I am trying to compile the BhPos software (Point of Sale for Linux.

 But I need the strtof function , but FreeBSD 4,9 does not have this
 function, it is possible to install it taking the source code from the 5.X
 FreeBSD branch?


C standard C89 had strtod but not strtof.
Strtof appears in the C99 standard.
The strtod returns a double type while strtof returns a float.
For most practical purposes you can substitute (float)strtod(...)
for strtof(...). There might be a difference in what happens on errors,
particularly if the converted result won't fit in a float variable, 
but this is not a likely problem if the author has chosen to use float 
rather than double. In most cases the cast (float) can be omitted.

I suggest you edit the application source to use strtod.

Malcolm

___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]


Problem compiling code in freeBSD 4,9 strtof related.

2004-03-26 Thread Eric De la Cruz Lugo
Hi, I am trying to compile the BhPos software (Point of Sale for Linux. 
 
But I need the strtof function , but FreeBSD 4,9 does not have this function, 
it is possible to install it taking the source code from the 5.X FreeBSD 
branch? 
 
here is my cc output: 
 
 
cc -O -pipe  -DLIBC_RCS -DSYSLIBC_RCS -I/usr/src/lib/libc/include 
-D__DBINTERFACE_PRIVATE -DINET6 -DPOSIX_MISTAKE 
-I/usr/src/lib/libc/../libc/locale -DBROKEN_DES -DYP  -c 
/usr/src/lib/libc/../libc/stdlib/strtof.c -o strtof.o 
In file included from /usr/include/gdtoaimp.h:180, 
 from /usr/src/lib/libc/../libc/stdlib/strtof.c:38: 
/usr/include/gdtoa.h:41: arith.h: No such file or directory 
In file included from /usr/src/lib/libc/../libc/stdlib/strtof.c:38: 
/usr/include/gdtoaimp.h:194: un-namespace.h: No such file or directory 
In file included from /usr/src/lib/libc/../libc/stdlib/strtof.c:38: 
/usr/include/gdtoaimp.h:278: syntax error before `one' 
/usr/include/gdtoaimp.h:278: syntax error before `IBM' 
/usr/include/gdtoaimp.h:281: syntax error before `}' 
*** Error code 1 
 
hope some one has a clue about how to solve this with out installing FreeBSD 
5.x 
 
thanks in advance. 
 
Eric De La Cruz Lugo 
Merida, Yucatan, Mexico. 
 

---
___
[EMAIL PROTECTED] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-questions
To unsubscribe, send any mail to [EMAIL PROTECTED]