]> git.vpit.fr Git - perl/modules/Variable-Magic.git/blobdiff - Magic.xs
MGf_COPY and MGf_DUP should always be set for the perls we consider
[perl/modules/Variable-Magic.git] / Magic.xs
index 5b3be56845e500fd76caa1429a2c9f0e2faac45d..334a0a84025d518b046383b0b2682d603422f6ea 100644 (file)
--- a/Magic.xs
+++ b/Magic.xs
@@ -139,14 +139,6 @@ STATIC SV *vmg_clone(pTHX_ SV *sv, tTHX owner) {
 # define PERL_MAGIC_tied 'P'
 #endif
 
-#ifndef MGf_COPY
-# define MGf_COPY 0
-#endif
-
-#ifndef MGf_DUP
-# define MGf_DUP 0
-#endif
-
 #ifndef MGf_LOCAL
 # define MGf_LOCAL 0
 #endif
@@ -441,12 +433,8 @@ typedef struct {
 
  SV *cb_data;
  SV *cb_get, *cb_set, *cb_len, *cb_clear, *cb_free;
-#if MGf_COPY
  SV *cb_copy;
-#endif /* MGf_COPY */
-#if MGf_DUP
  SV *cb_dup;
-#endif /* MGf_DUP */
 #if MGf_LOCAL
  SV *cb_local;
 #endif /* MGf_LOCAL */
@@ -499,12 +487,10 @@ STATIC void vmg_mgwiz_free(pTHX_ MGWIZ *w) {
  SvREFCNT_dec(w->cb_len);
  SvREFCNT_dec(w->cb_clear);
  SvREFCNT_dec(w->cb_free);
-#if MGf_COPY
  SvREFCNT_dec(w->cb_copy);
-#endif /* MGf_COPY */
-#if 0 /* MGf_DUP */
+#if 0
  SvREFCNT_dec(w->cb_dup);
-#endif /* MGf_DUP */
+#endif
 #if MGf_LOCAL
  SvREFCNT_dec(w->cb_local);
 #endif /* MGf_LOCAL */
@@ -550,12 +536,8 @@ STATIC MGWIZ *vmg_mgwiz_clone(pTHX_ const MGWIZ *w) {
  VMG_CLONE_CB(len);
  VMG_CLONE_CB(clear);
  VMG_CLONE_CB(free);
-#if MGf_COPY
  VMG_CLONE_CB(copy);
-#endif /* MGf_COPY */
-#if MGf_DUP
  VMG_CLONE_CB(dup);
-#endif /* MGf_DUP */
 #if MGf_LOCAL
  VMG_CLONE_CB(local);
 #endif /* MGf_LOCAL */
@@ -631,12 +613,8 @@ STATIC MGVTBL vmg_wizard_vtbl = {
  NULL,            /* len */
  NULL,            /* clear */
  vmg_wizard_free, /* free */
-#if MGf_COPY
  NULL,            /* copy */
-#endif /* MGf_COPY */
-#if MGf_DUP
  NULL,            /* dup */
-#endif /* MGf_DUP */
 #if MGf_LOCAL
  NULL,            /* local */
 #endif /* MGf_LOCAL */
@@ -817,14 +795,12 @@ STATIC UV vmg_cast(pTHX_ SV *sv, const SV *wiz, SV **args, I32 items) {
                               (const char *) wiz, HEf_SVKEY);
  SvREFCNT_dec(data);
  mg->mg_private = SIG_WIZ;
-#if MGf_COPY
  if (w->cb_copy)
   mg->mg_flags |= MGf_COPY;
-#endif /* MGf_COPY */
-#if 0 /* MGf_DUP */
+#if 0
  if (w->cb_dup)
   mg->mg_flags |= MGf_DUP;
-#endif /* MGf_DUP */
+#endif
 #if MGf_LOCAL
  if (w->cb_local)
   mg->mg_flags |= MGf_LOCAL;
@@ -1224,7 +1200,6 @@ STATIC int vmg_svt_free(pTHX_ SV *sv, MAGIC *mg) {
  return ret;
 }
 
-#if MGf_COPY
 STATIC int vmg_svt_copy(pTHX_ SV *sv, MAGIC *mg, SV *nsv, const char *key,
 # if VMG_HAS_PERL_MAINT(5, 11, 0, 33256) || VMG_HAS_PERL(5, 12, 0)
   I32 keylen
@@ -1250,13 +1225,12 @@ STATIC int vmg_svt_copy(pTHX_ SV *sv, MAGIC *mg, SV *nsv, const char *key,
 
  return ret;
 }
-#endif /* MGf_COPY */
 
-#if 0 /*  MGf_DUP */
+#if 0
 STATIC int vmg_svt_dup(pTHX_ MAGIC *mg, CLONE_PARAMS *param) {
  return 0;
 }
-#endif /* MGf_DUP */
+#endif
 
 #if MGf_LOCAL
 STATIC int vmg_svt_local(pTHX_ SV *nsv, MAGIC *mg) {
@@ -1470,13 +1444,7 @@ PREINIT:
 CODE:
  dMY_CXT;
 
- if (items != 7
-#if MGf_COPY
-              + 1
-#endif /* MGf_COPY */
-#if MGf_DUP
-              + 1
-#endif /* MGf_DUP */
+ if (items != 9
 #if MGf_LOCAL
               + 1
 #endif /* MGf_LOCAL */
@@ -1496,15 +1464,11 @@ CODE:
  VMG_SET_SVT_CB(ST(i++), len);
  VMG_SET_SVT_CB(ST(i++), clear);
  VMG_SET_SVT_CB(ST(i++), free);
-#if MGf_COPY
  VMG_SET_SVT_CB(ST(i++), copy);
-#endif /* MGf_COPY */
-#if MGf_DUP
  /* VMG_SET_SVT_CB(ST(i++), dup); */
  i++;
  t->svt_dup = NULL;
  w->cb_dup  = NULL;
-#endif /* MGf_DUP */
 #if MGf_LOCAL
  VMG_SET_SVT_CB(ST(i++), local);
 #endif /* MGf_LOCAL */