[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

[MacPerl-Porters] Fix for arithmetic errors in SC and MrC builds



Larry Moore <ljmoore@freespace.net> writes:
>At 23:33 +0200 5/05/2000, Matthias Neeracher wrote:
>>So, my first impression of the new build is that it fulfills its objective:
>>Building (at least up to miniperl) now is achievable for somebody with an ftp
>>client and some programming experience.
>
>and the ppc and 68K packages. The SC build experiences difficulties with
>the Exporter module. Fail.

Hey, I said build, not run :-)

Anyway, here's a fix for the arithmetic errors: Apply the following patch in
the macos directory:

diff -u Chambers:macish.c :macish.c
--- Chambers:macish.c	Mon Mar 20 00:36:05 2000
+++ :macish.c	Wed May 10 00:02:27 2000
@@ -8,6 +8,8 @@
 #include <Resources.h>
 #include <Folders.h>
 #include <GUSIFileSpec.h>
+#undef modff
+#include <fp.h>
 
 /* Borrowed from msdos.c
  * Just pretend that everyone is a superuser
@@ -647,5 +649,14 @@
 	*iptr	= i;
 	
 	return res;
+}
+#endif
+
+#if defined(__SC__) || defined(__MRC__)
+double Perl_atof(const char *s)
+{
+	double f = atof(s);
+	
+	return isnan(f) ? 0.0 : f;
 }
 #endif
diff -u Chambers:macish.h :macish.h
--- Chambers:macish.h	Sun Apr  2 23:24:45 2000
+++ :macish.h	Tue May  9 23:53:19 2000
@@ -205,3 +205,8 @@
 #undef Perl_modf
 double Perl_modf(double x, double * iptr);
 #endif
+
+#if defined(__SC__) || defined(__MRC__)
+#undef Perl_atof
+double Perl_atof(const char *s);
+#endif

Delete all object files and rebuild.

The problem was that the MPW compilers have nonstandard error handling for
atof.
 
Matthias

-- 
Matthias Neeracher   <neeri@iis.ee.ethz.ch>   http://www.iis.ee.ethz.ch/~neeri
   " `For tactical reasons,' the blonde said, `we do not currently advocate
    the use of violence or sorcery against private individuals.' " 
                                        -- William Gibson, _Virtual Light_

==== Want to unsubscribe from this list?
==== Send mail with body "unsubscribe" to macperl-porters-request@macperl.org