diff options
author | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-01-29 20:55:24 +0100 |
---|---|---|
committer | Matthias Benkard <code@mail.matthias.benkard.de> | 2008-01-29 20:55:24 +0100 |
commit | a115ef0d3cfab649b0bb74799eba6896e6b44f21 (patch) | |
tree | ff3a7eb38fab5ec373436a9cfd46c131faf48092 | |
parent | 64c0dae830fa3319bb31cd1cd9ec659ea1d72ef8 (diff) |
Objective-C layer: Add function objcl_objc2_p.
darcs-hash:e9c9605cc47cc04e36e2ba9e60f76aea097e77bd
-rw-r--r-- | Lisp/libobjcl.lisp | 5 | ||||
-rw-r--r-- | Objective-C/libobjcl.h | 3 | ||||
-rw-r--r-- | Objective-C/libobjcl.m | 11 |
3 files changed, 19 insertions, 0 deletions
diff --git a/Lisp/libobjcl.lisp b/Lisp/libobjcl.lisp index a726db8..752dcf4 100644 --- a/Lisp/libobjcl.lisp +++ b/Lisp/libobjcl.lisp @@ -83,6 +83,8 @@ (defcfun ("objcl_get_runtime_type" %objcl-get-runtime-type) :string) +(defcfun ("objcl_objc2_p" %objcl-objc2-p) :int) + (defcfun ("objcl_sizeof_type" %objcl-sizeof-type) :long (typespec :string)) @@ -678,3 +680,6 @@ separating parts by hyphens works nicely in all of the `:INVERT`, runtime) (cond ((string= runtime "GNU") :gnu) ((string= runtime "NeXT") :next)))) + +(defun objc-2.0-runtime-p () + (not (zerop (%objcl-objc2-p)))) diff --git a/Objective-C/libobjcl.h b/Objective-C/libobjcl.h index e5a70f1..9008c9e 100644 --- a/Objective-C/libobjcl.h +++ b/Objective-C/libobjcl.h @@ -104,6 +104,9 @@ objcl_get_no (void); const char * objcl_get_runtime_type (void); +int +objcl_objc2_p (void); + long objcl_sizeof_type (const char *typespec); diff --git a/Objective-C/libobjcl.m b/Objective-C/libobjcl.m index 58baf67..3fc2300 100644 --- a/Objective-C/libobjcl.m +++ b/Objective-C/libobjcl.m @@ -331,6 +331,17 @@ objcl_get_runtime_type (void) } +int +objcl_objc2_p (void) +{ +#ifdef __OBJC2__ + return 1; +#else + return 0; +#endif +} + + long objcl_sizeof_type (const char *typespec) { |