diff options
Diffstat (limited to 'Objective-C')
-rw-r--r-- | Objective-C/libobjcl.h | 8 | ||||
-rw-r--r-- | Objective-C/libobjcl.m | 18 |
2 files changed, 26 insertions, 0 deletions
diff --git a/Objective-C/libobjcl.h b/Objective-C/libobjcl.h index a912748..8b37609 100644 --- a/Objective-C/libobjcl.h +++ b/Objective-C/libobjcl.h @@ -94,3 +94,11 @@ objcl_object_get_meta_class (id obj); id objcl_get_nil (void); + +/* In principle, we do not know whether a BOOL fits into a long. In + practise, it is very likely. */ +long +objcl_get_yes (); + +long +objcl_get_no (); diff --git a/Objective-C/libobjcl.m b/Objective-C/libobjcl.m index eaffb8c..15855ed 100644 --- a/Objective-C/libobjcl.m +++ b/Objective-C/libobjcl.m @@ -457,3 +457,21 @@ objcl_get_nil (void) { return nil; } + + +long +objcl_get_yes () +{ + if (sizeof (YES) > sizeof (long)) + fprintf (stderr, "WARNING: objcl_get_yes: YES might not fit into a long.\n"); + return YES; +} + + +long +objcl_get_no () +{ + if (sizeof (NO) > sizeof (long)) + fprintf (stderr, "WARNING: objcl_get_no: NO might not fit into a long.\n"); + return NO; +} |