Assorted 2.15 fixes.
[p5sagit/p5-mst-13.2.git] / sv.h
diff --git a/sv.h b/sv.h
index 04fef7c..bfc4778 100644 (file)
--- a/sv.h
+++ b/sv.h
@@ -275,44 +275,76 @@ perform the upgrade if necessary.  See C<svtype>.
 #define SVpav_REIFY    0x80000000      /* can become real */
 
 struct xpv {
+    IV         xpv_dummy;      /* This isn't allocated. */
     STRLEN     xpv_cur;        /* length of sv_pv as a C string */
     STRLEN     xpv_len;        /* allocated size */
 };
 
+typedef struct xpv xpv_allocated;
+
 struct xpviv {
+    IV         xiv_iv;         /* integer value or pv offset */
     STRLEN     xpv_cur;        /* length of sv_pv as a C string */
     STRLEN     xpv_len;        /* allocated size */
-    IV         xiv_iv;         /* integer value or pv offset */
 };
 
 struct xpvuv {
+    UV         xuv_uv;         /* unsigned value or pv offset */
     STRLEN     xpv_cur;        /* length of sv_pv as a C string */
     STRLEN     xpv_len;        /* allocated size */
-    UV         xuv_uv;         /* unsigned value or pv offset */
 };
 
 struct xpvnv {
+    IV         xiv_iv;         /* integer value or pv offset */
     STRLEN     xpv_cur;        /* length of sv_pv as a C string */
     STRLEN     xpv_len;        /* allocated size */
-    IV         xiv_iv;         /* integer value or pv offset */
-    NV         xnv_nv;         /* numeric value, if any */
+    union {
+       NV      xnvu_nv;        /* numeric value, if any */
+       struct {
+           void *xnv_p1;
+           union {
+               void *xnv_p2;
+               IV xnv_i2;
+           }   xnv_u2;
+       }       xnv_s;
+    }          xnv_u;
 };
 
+#define xnv_nv xnv_u.xnvu_nv
+
 /* These structure must match the beginning of struct xpvhv in hv.h. */
 struct xpvmg {
+    IV         xiv_iv;         /* integer value or pv offset */
     STRLEN     xpv_cur;        /* length of sv_pv as a C string */
     STRLEN     xpv_len;        /* allocated size */
-    IV         xiv_iv;         /* integer value or pv offset */
-    NV         xnv_nv;         /* numeric value, if any */
+    union {
+       NV      xnvu_nv;        /* numeric value, if any */
+       struct {
+           void *xnv_p1;
+           union {
+               void *xnv_p2;
+               IV xnv_i2;
+           }   xnv_u2;
+       }       xnv_s;
+    }          xnv_u;
     MAGIC*     xmg_magic;      /* linked list of magicalness */
     HV*                xmg_stash;      /* class package */
 };
 
 struct xpvlv {
+    IV         xiv_iv;         /* integer value or pv offset */
     STRLEN     xpv_cur;        /* length of sv_pv as a C string */
     STRLEN     xpv_len;        /* allocated size */
-    IV         xiv_iv;         /* integer value or pv offset */
-    NV         xnv_nv;         /* numeric value, if any */
+    union {
+       NV      xnvu_nv;        /* numeric value, if any */
+       struct {
+           void *xnv_p1;
+           union {
+               void *xnv_p2;
+               IV xnv_i2;
+           }   xnv_u2;
+       }       xnv_s;
+    }          xnv_u;
     MAGIC*     xmg_magic;      /* linked list of magicalness */
     HV*                xmg_stash;      /* class package */
 
@@ -331,10 +363,19 @@ struct xpvlv {
 };
 
 struct xpvgv {
+    IV         xiv_iv;         /* integer value or pv offset */
     STRLEN     xpv_cur;        /* length of sv_pv as a C string */
     STRLEN     xpv_len;        /* allocated size */
-    IV         xiv_iv;         /* integer value or pv offset */
-    NV         xnv_nv;         /* numeric value, if any */
+    union {
+       NV      xnvu_nv;        /* numeric value, if any */
+       struct {
+           void *xnv_p1;
+           union {
+               void *xnv_p2;
+               IV xnv_i2;
+           }   xnv_u2;
+       }       xnv_s;
+    }          xnv_u;
     MAGIC*     xmg_magic;      /* linked list of magicalness */
     HV*                xmg_stash;      /* class package */
 
@@ -346,10 +387,19 @@ struct xpvgv {
 };
 
 struct xpvbm {
+    IV         xiv_iv;         /* integer value or pv offset */
     STRLEN     xpv_cur;        /* length of sv_pv as a C string */
     STRLEN     xpv_len;        /* allocated size */
-    IV         xiv_iv;         /* integer value or pv offset */
-    NV         xnv_nv;         /* numeric value, if any */
+    union {
+       NV      xnvu_nv;        /* numeric value, if any */
+       struct {
+           void *xnv_p1;
+           union {
+               void *xnv_p2;
+               IV xnv_i2;
+           }   xnv_u2;
+       }       xnv_s;
+    }          xnv_u;
     MAGIC*     xmg_magic;      /* linked list of magicalness */
     HV*                xmg_stash;      /* class package */
 
@@ -363,10 +413,19 @@ struct xpvbm {
 typedef U16 cv_flags_t;
 
 struct xpvfm {
+    IV         xiv_iv;         /* integer value or pv offset */
     STRLEN     xpv_cur;        /* length of sv_pv as a C string */
     STRLEN     xpv_len;        /* allocated size */
-    IV         xiv_iv;         /* integer value or pv offset */
-    NV         xnv_nv;         /* numeric value, if any */
+    union {
+       NV      xnvu_nv;        /* numeric value, if any */
+       struct {
+           void *xnv_p1;
+           union {
+               void *xnv_p2;
+               IV xnv_i2;
+           }   xnv_u2;
+       }       xnv_s;
+    }          xnv_u;
     MAGIC*     xmg_magic;      /* linked list of magicalness */
     HV*                xmg_stash;      /* class package */
 
@@ -388,10 +447,19 @@ struct xpvfm {
 };
 
 struct xpvio {
+    IV         xiv_iv;         /* integer value or pv offset */
     STRLEN     xpv_cur;        /* length of sv_pv as a C string */
     STRLEN     xpv_len;        /* allocated size */
-    IV         xiv_iv;         /* integer value or pv offset */
-    NV         xnv_nv;         /* numeric value, if any */
+    union {
+       NV      xnvu_nv;        /* numeric value, if any */
+       struct {
+           void *xnv_p1;
+           union {
+               void *xnv_p2;
+               IV xnv_i2;
+           }   xnv_u2;
+       }       xnv_s;
+    }          xnv_u;
     MAGIC*     xmg_magic;      /* linked list of magicalness */
     HV*                xmg_stash;      /* class package */
 
@@ -1422,3 +1490,13 @@ struct clone_params {
   UV  flags;
   PerlInterpreter *proto_perl;
 };
+
+/*
+ * Local variables:
+ * c-indentation-style: bsd
+ * c-basic-offset: 4
+ * indent-tabs-mode: t
+ * End:
+ *
+ * ex: set ts=8 sts=4 sw=4 noet:
+ */