ExternalBytes.st
branchjv
changeset 18608 7d521f25267c
parent 18120 e3a375d5f6a8
parent 18583 6a555df5d859
child 18610 b9799e74a9c5
--- a/ExternalBytes.st	Sun Jul 12 06:35:39 2015 +0200
+++ b/ExternalBytes.st	Mon Jul 20 17:01:03 2015 +0100
@@ -565,6 +565,36 @@
 
 !ExternalBytes class methodsFor:'queries'!
 
+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
+    "
+!
+
+longAlignment
+    "return the alignement of longs in structs and unions"
+
+%{  /* NOCONTEXT */
+    struct {
+        char c;
+        long l;
+    } dummy;
+    RETURN (__mkSmallInteger( (char *)&dummy.l - (char *)&dummy.c ));
+%}
+    "
+     ExternalBytes longAlignment
+    "
+!
+
 isBuiltInClass
     "return true if this class is known by the run-time-system.
      Here, true is returned."
@@ -1356,11 +1386,11 @@
 !ExternalBytes class methodsFor:'documentation'!
 
 version
-    ^ '$Header: /cvs/stx/stx/libbasic/ExternalBytes.st,v 1.93 2015-03-18 18:17:52 cg Exp $'
+    ^ '$Header$'
 !
 
 version_CVS
-    ^ '$Header: /cvs/stx/stx/libbasic/ExternalBytes.st,v 1.93 2015-03-18 18:17:52 cg Exp $'
+    ^ '$Header$'
 ! !