class: ExternalBytes
changes:
#doubleAlignment
#longAlignment
Borland does not know size of void*
--- a/ExternalBytes.st Wed Jul 15 16:40:19 2015 +0200
+++ b/ExternalBytes.st Wed Jul 15 16:56:42 2015 +0200
@@ -580,6 +580,36 @@
"
!
+longAlignment
+ "return the alignement of longs in structs and unions"
+
+%{ /* NOCONTEXT */
+ struct {
+ char c;
+ long l;
+ } dummy;
+ RETURN (__mkSmallInteger( (void*)&dummy.l - (void *)&dummy.c ));
+%}
+ "
+ ExternalBytes longAlignment
+ "
+!
+
+doubleAlignment
+ "return the alignement of longs in structs and unions"
+
+%{ /* NOCONTEXT */
+ struct {
+ char c;
+ double d;
+ } dummy;
+ RETURN (__mkSmallInteger( (char *)&dummy.d - (char *)&dummy.c ));
+%}
+ "
+ ExternalBytes doubleAlignment
+ "
+!
+
isBuiltInClass
"return true if this class is known by the run-time-system.
Here, true is returned."
@@ -597,7 +627,7 @@
char c;
long l;
} dummy;
- RETURN (__mkSmallInteger( (void*)&dummy.l - (void *)&dummy.c ));
+ RETURN (__mkSmallInteger( (char *)&dummy.l - (char *)&dummy.c ));
%}
"
ExternalBytes longAlignment