pkgsrc/lang/vslisp/patches/patch-ac
jmc 3804345481 Port for powerpc (or any other arch which enforces alignment).
This code was assuming it could copy double's in/out of char *'s with just
casts and normal copies. This blows up on anything which enforces alignments.

Change the generic case for the ATOM to just have a special double field.

For the serialization routines memcpy the double in and provide a union to
memcpy it out to that also contains a single double value. This ensures
alignment is correct and it won't SIGBUS anymore.

Bump pkg to nb1
2002-03-15 00:22:42 +00:00

21 lines
536 B
Text

$NetBSD: patch-ac,v 1.1 2002/03/15 00:22:42 jmc Exp $
--- src/l_defs.h.orig Fri Mar 15 00:16:28 2002
+++ src/l_defs.h Fri Mar 15 00:16:40 2002
@@ -69,6 +69,7 @@
uc * a;
/** Additional information */
uc * b;
+ double d;
};
/** ATOM pointer */
typedef struct _ato * ATOM;
@@ -141,7 +142,7 @@
ATOM MakeDAtom(double d);
ATOM MakeFAtom(FILE *d);
/* double GetDouble(ATOM a); */
-#define GetDouble(at) (*((double *)((at)->a)))
+#define GetDouble(at) ((at)->d)
int kilatom(ATOM a);
int killlist(LIST l);
int kilat(ATOM a);