summaryrefslogtreecommitdiff
path: root/Objective-C
diff options
context:
space:
mode:
Diffstat (limited to 'Objective-C')
-rw-r--r--Objective-C/libobjcl.h12
-rw-r--r--Objective-C/libobjcl.m38
2 files changed, 50 insertions, 0 deletions
diff --git a/Objective-C/libobjcl.h b/Objective-C/libobjcl.h
index c84dbb9..2ebea37 100644
--- a/Objective-C/libobjcl.h
+++ b/Objective-C/libobjcl.h
@@ -69,3 +69,15 @@ objcl_get_yes (void);
long
objcl_get_no (void);
+
+const char *
+objcl_get_runtime_type (void);
+
+long
+objcl_sizeof_type (const char *typespec);
+
+long
+objcl_sizeof_return_type (const char *typespec);
+
+long
+objcl_alignof_type (const char *typespec);
diff --git a/Objective-C/libobjcl.m b/Objective-C/libobjcl.m
index 205a998..8c4f3fd 100644
--- a/Objective-C/libobjcl.m
+++ b/Objective-C/libobjcl.m
@@ -248,3 +248,41 @@ objcl_get_no (void)
fprintf (stderr, "WARNING: objcl_get_no: NO might not fit into a long.\n");
return NO;
}
+
+
+const char *
+objcl_get_runtime_type (void)
+{
+#ifdef __NEXT_RUNTIME__
+ return "NeXT";
+#else
+ return "GNU";
+#endif
+}
+
+
+long
+objcl_sizeof_type (const char *typespec)
+{
+ if (sizeof (ssize_t) > sizeof (long))
+ fprintf (stderr, "WARNING: objcl_sizeof_typespec: Size might not fit into a long.\n");
+ return PyObjCRT_SizeOfType (typespec);
+}
+
+
+long
+objcl_sizeof_return_type (const char *typespec)
+{
+ if (sizeof (ssize_t) > sizeof (long))
+ fprintf (stderr, "WARNING: objcl_sizeof_return_typespec: Size might not fit into a long.\n");
+ return PyObjCRT_SizeOfReturnType (typespec);
+}
+
+
+long
+objcl_alignof_type (const char *typespec)
+{
+ if (sizeof (ssize_t) > sizeof (long))
+ fprintf (stderr, "WARNING: objcl_align_typespec: Alignment might not fit into a long.\n");
+ return PyObjCRT_AlignOfType (typespec);
+}