#FEATURE by cg
authorClaus Gittinger <cg@exept.de>
Tue, 08 May 2018 23:16:38 +0200
changeset 22803 a15c29b8a89c
parent 22802 95ea0b61a61e
child 22804 1811fc3f6f19
#FEATURE by cg class: ExternalAddress class added: #uintSize #ulongSize #ushortSize
ExternalAddress.st
--- a/ExternalAddress.st	Tue May 08 23:05:03 2018 +0200
+++ b/ExternalAddress.st	Tue May 08 23:16:38 2018 +0200
@@ -1,3 +1,5 @@
+"{ Encoding: utf8 }"
+
 "
  COPYRIGHT (c) 1995 by Claus Gittinger
 	      All Rights Reserved
@@ -192,6 +194,42 @@
     "
 
     "Created: / 15-11-2016 / 11:40:52 / cg"
+!
+
+uintSize
+    "answer the size in bytes of an unsigned int."
+
+%{ /* NOCONTEXT */
+    RETURN(__mkSmallInteger(sizeof(unsigned int)));
+%}.
+
+    "
+     self uintSize
+    "
+!
+
+ulongSize
+    "answer the size in bytes of an unsigned long."
+
+%{ /* NOCONTEXT */
+    RETURN(__mkSmallInteger(sizeof(unsigned long)));
+%}.
+
+    "
+     self ulongSize
+    "
+!
+
+ushortSize
+    "answer the size in bytes of an unsigned short."
+
+%{ /* NOCONTEXT */
+    RETURN(__mkSmallInteger(sizeof(unsigned short)));
+%}.
+
+    "
+     self ushortSize
+    "
 ! !
 
 !ExternalAddress methodsFor:'Compatibility-Squeak'!