This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf16_to_utf8() should croak on encountering a bare low surrogate.
[perl5.git] / sv.h
diff --git a/sv.h b/sv.h
index 8c83e9a..0146de4 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -398,13 +398,10 @@ perform the upgrade if necessary.  See C<svtype>.
 /* RV upwards. However, SVf_ROK and SVp_IOK are exclusive  */
 #define SVprv_WEAKREF   0x80000000  /* Weak reference */
 
-#define _XPV_ALLOCATED_HEAD                                            \
-    STRLEN     xpv_cur;        /* length of svu_pv as a C string */    \
-    STRLEN     xpv_len         /* allocated size */
-
 #define _XPV_HEAD      \
     union _xnvu xnv_u; \
-    _XPV_ALLOCATED_HEAD
+    STRLEN     xpv_cur;        /* length of svu_pv as a C string */    \
+    STRLEN     xpv_len         /* allocated size */
 
 union _xnvu {
     NV     xnv_nv;             /* numeric value, if any */
@@ -439,20 +436,11 @@ struct xpv {
     _XPV_HEAD;
 };
 
-typedef struct {
-    _XPV_ALLOCATED_HEAD;
-} xpv_allocated;
-
 struct xpviv {
     _XPV_HEAD;
     union _xivu xiv_u;
 };
 
-typedef struct {
-    _XPV_ALLOCATED_HEAD;
-    union _xivu xiv_u;
-} xpviv_allocated;
-
 #define xiv_iv xiv_u.xivu_iv
 
 struct xpvuv {
@@ -472,7 +460,7 @@ struct xpvnv {
     union _xmgu        xmg_u;                              \
     HV*                xmg_stash       /* class package */
 
-/* These structure must match the beginning of struct xpvhv in hv.h. */
+/* This structure must match the beginning of struct xpvhv in hv.h. */
 struct xpvmg {
     _XPV_HEAD;
     _XPVMG_HEAD;
@@ -525,12 +513,6 @@ struct xpvfm {
     _XPVCV_COMMON;
 };
 
-typedef struct {
-    _XPV_ALLOCATED_HEAD;
-    _XPVMG_HEAD;
-    _XPVCV_COMMON;
-} xpvfm_allocated;
-
 #define _XPVIO_TAIL                                                    \
     PerlIO *   xio_ifp;        /* ifp and ofp are normally the same */ \
     PerlIO *   xio_ofp;        /* but sockets need separate streams */ \
@@ -567,12 +549,6 @@ struct xpvio {
     _XPVIO_TAIL;
 };
 
-typedef struct {
-    _XPV_ALLOCATED_HEAD;
-    _XPVMG_HEAD;
-    _XPVIO_TAIL;
-} xpvio_allocated;
-
 #define xio_dirp       xio_dirpu.xiou_dirp
 #define xio_any                xio_dirpu.xiou_any
 
@@ -915,7 +891,7 @@ the scalar's value cannot change unless written to.
 
 #define SvGAMAGIC(sv)           (SvGMAGICAL(sv) || SvAMAGIC(sv))
 
-#define Gv_AMG(stash)           (PL_amagic_generation && Gv_AMupdate(stash))
+#define Gv_AMG(stash)           (PL_amagic_generation && Gv_AMupdate(stash, FALSE))
 
 #define SvWEAKREF(sv)          ((SvFLAGS(sv) & (SVf_ROK|SVprv_WEAKREF)) \
                                  == (SVf_ROK|SVprv_WEAKREF))
@@ -2022,6 +1998,9 @@ Evaluates I<sv> more than once. Sets I<len> to 0 if C<SvOOK(sv)> is false.
        }                                                               \
     } STMT_END
 #endif
+
+#define newIO()        MUTABLE_IO(newSV_type(SVt_PVIO))
+
 /*
  * Local variables:
  * c-indentation-style: bsd