Fix bug in DynaLoader, which has been passing a filename in dynamic
[p5sagit/p5-mst-13.2.git] / sv.h
diff --git a/sv.h b/sv.h
index f2f2fea..71389c9 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -978,26 +978,34 @@ in gv.h: */
 
 #define SvAMAGIC(sv)           (SvROK(sv) && (SvFLAGS(SvRV(sv)) & SVf_AMAGIC))
 #if defined(__GNUC__) && !defined(PERL_GCC_BRACE_GROUPS_FORBIDDEN)
-#  define SvAMAGIC_on(sv)      ({ SV *kloink = sv;                     \
+#  define SvAMAGIC_on(sv)      ({ SV * const kloink = sv;              \
                                   assert(SvROK(kloink));               \
                                   SvFLAGS(SvRV(kloink)) |= SVf_AMAGIC; \
                                })
-#  define SvAMAGIC_off(sv)     ({ SV *kloink = sv;                     \
+#  define SvAMAGIC_off(sv)     ({ SV * const kloink = sv;              \
                                   if(SvROK(kloink))                    \
                                        SvFLAGS(SvRV(kloink)) &= ~SVf_AMAGIC;\
                                })
 #else
 #  define SvAMAGIC_on(sv)      (SvFLAGS(SvRV(sv)) |= SVf_AMAGIC)
-#  define SvAMAGIC_off(sv)     (SvROK(sv) && SvFLAGS(SvRV(sv)) &= ~SVf_AMAGIC)
+#  define SvAMAGIC_off(sv) \
+       (SvROK(sv) && (SvFLAGS(SvRV(sv)) &= ~SVf_AMAGIC))
 #endif
 
-#define SvGAMAGIC(sv)           (SvGMAGICAL(sv) || SvAMAGIC(sv))
-
 /*
-#define Gv_AMG(stash) \
-        (HV_AMAGICmb(stash) && \
-         ((!HV_AMAGICbad(stash) && HV_AMAGIC(stash)) || Gv_AMupdate(stash)))
+=for apidoc Am|char*|SvGAMAGIC|SV* sv
+
+Returns true if the SV has get magic or overloading. If either is true then
+the scalar is active data, and has the potential to return a new value every
+time it is accessed. Hence you must be careful to only read it once per user
+logical operation and work with that returned value. If neither is true then
+the scalar's value cannot change unless written to.
+
+=cut
 */
+
+#define SvGAMAGIC(sv)           (SvGMAGICAL(sv) || SvAMAGIC(sv))
+
 #define Gv_AMG(stash)           (PL_amagic_generation && Gv_AMupdate(stash))
 
 #define SvWEAKREF(sv)          ((SvFLAGS(sv) & (SVf_ROK|SVprv_WEAKREF)) \
@@ -1641,9 +1649,12 @@ Like C<sv_catsv> but doesn't process magic.
 #define SV_CONST_RETURN                32
 #define SV_MUTABLE_RETURN      64
 #define SV_SMAGIC              128
+#define SV_HAS_TRAILING_NUL    256
 
 #define sv_unref(sv)           sv_unref_flags(sv, 0)
 #define sv_force_normal(sv)    sv_force_normal_flags(sv, 0)
+#define sv_usepvn(sv, p, l)    sv_usepvn_flags(sv, p, l, 0)
+#define sv_usepvn_mg(sv, p, l) sv_usepvn_flags(sv, p, l, SV_SMAGIC)
 
 /* We are about to replace the SV's current value. So if it's copy on write
    we need to normalise it. Use the SV_COW_DROP_PV flag hint to say that