Bring SvOOK_on back, but simpler
authorFather Chrysostomos <sprout@cpan.org>
Thu, 1 Dec 2011 20:29:06 +0000 (12:29 -0800)
committerFather Chrysostomos <sprout@cpan.org>
Thu, 1 Dec 2011 21:00:05 +0000 (13:00 -0800)
Commit 404dce59 removed it, because nothing in core or CPAN was using
it and it is not part of the API.

Nothing in core was using it because it was unusable as previously
defined (with SvIOK_off).

This commit brings it back, but now it is a simple flag-setting macro,
that will actually be usable by the core.

sv.h

diff --git a/sv.h b/sv.h
index dcd53f7..33a61be 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -848,6 +848,7 @@ in gv.h: */
                                 ? mg_find(sv,PERL_MAGIC_vstring) : NULL)
 
 #define SvOOK(sv)              (SvFLAGS(sv) & SVf_OOK)
+#define SvOOK_on(sv)           (SvFLAGS(sv) |= SVf_OOK)
 #define SvOOK_off(sv)          ((void)(SvOOK(sv) && sv_backoff(sv)))
 
 #define SvFAKE(sv)             (SvFLAGS(sv) & SVf_FAKE)