summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-01-23 14:44:59 +0000
committerRafael Garcia-Suarez <rgarciasuarez@gmail.com>2006-01-23 14:44:59 +0000
commit92e67595817e2efa2a2f6c3e6498b1f1babb5fbd (patch)
tree76b73812aa48ecb7c930efd8074555c3ce07c6f3
parentc9869e1c0cac4f243c84d27552ad981d5363e0f7 (diff)
downloadperl-92e67595817e2efa2a2f6c3e6498b1f1babb5fbd.tar.gz
Un-const magic virtual tables; this consting breaks the nasty
things done by Swig, as noticed by Audrey. p4raw-id: //depot/perl@26924
-rw-r--r--embed.fnc2
-rw-r--r--mg.c2
-rw-r--r--mg.h2
-rw-r--r--perl.h8
-rw-r--r--pod/perlapi.pod2
-rw-r--r--proto.h2
-rw-r--r--sv.c4
7 files changed, 11 insertions, 11 deletions
diff --git a/embed.fnc b/embed.fnc
index d3fd5bb47d..9cd0ff1a1a 100644
--- a/embed.fnc
+++ b/embed.fnc
@@ -790,7 +790,7 @@ Apd |STRLEN |sv_len |NULLOK SV* sv
Apd |STRLEN |sv_len_utf8 |NULLOK SV* sv
Apd |void |sv_magic |NN SV* sv|NULLOK SV* obj|int how|NULLOK const char* name \
|I32 namlen
-Apd |MAGIC *|sv_magicext |NN SV* sv|NULLOK SV* obj|int how|NULLOK const MGVTBL *vtbl \
+Apd |MAGIC *|sv_magicext |NN SV* sv|NULLOK SV* obj|int how|NULLOK MGVTBL *vtbl \
|NULLOK const char* name|I32 namlen
ApdaR |SV* |sv_mortalcopy |NULLOK SV* oldsv
ApdR |SV* |sv_newmortal
diff --git a/mg.c b/mg.c
index fb47f1f7ed..a85cc46394 100644
--- a/mg.c
+++ b/mg.c
@@ -409,7 +409,7 @@ Perl_mg_localize(pTHX_ SV *sv, SV *nsv)
dVAR;
MAGIC *mg;
for (mg = SvMAGIC(sv); mg; mg = mg->mg_moremagic) {
- const MGVTBL* const vtbl = mg->mg_virtual;
+ MGVTBL* const vtbl = mg->mg_virtual;
switch (mg->mg_type) {
/* value magic types: don't copy */
case PERL_MAGIC_bm:
diff --git a/mg.h b/mg.h
index 3e9073211c..a373defc99 100644
--- a/mg.h
+++ b/mg.h
@@ -26,7 +26,7 @@ struct mgvtbl {
struct magic {
MAGIC* mg_moremagic;
- const MGVTBL* mg_virtual; /* pointer to magic functions */
+ MGVTBL* mg_virtual; /* pointer to magic functions */
U16 mg_private;
char mg_type;
U8 mg_flags;
diff --git a/perl.h b/perl.h
index fb0f1e9d74..f4d20f8b41 100644
--- a/perl.h
+++ b/perl.h
@@ -4344,11 +4344,11 @@ END_EXTERN_C
START_EXTERN_C
#ifdef DOINIT
-# define MGVTBL_SET(var,a,b,c,d,e,f,g) EXTCONST MGVTBL var = {a,b,c,d,e,f,g}
-# define MGVTBL_SET_CONST_MAGIC_GET(var,a,b,c,d,e,f,g) EXTCONST MGVTBL var = {(int (*)(pTHX_ SV *, MAGIC *))a,b,c,d,e,f,g} /* Like MGVTBL_SET but with the get magic having a const MG* */
+# define MGVTBL_SET(var,a,b,c,d,e,f,g) EXT MGVTBL var = {a,b,c,d,e,f,g}
+# define MGVTBL_SET_CONST_MAGIC_GET(var,a,b,c,d,e,f,g) EXT MGVTBL var = {(int (*)(pTHX_ SV *, MAGIC *))a,b,c,d,e,f,g} /* Like MGVTBL_SET but with the get magic having a const MG* */
#else
-# define MGVTBL_SET(var,a,b,c,d,e,f,g) EXTCONST MGVTBL var
-# define MGVTBL_SET_CONST_MAGIC_GET(var,a,b,c,d,e,f,g) EXTCONST MGVTBL var
+# define MGVTBL_SET(var,a,b,c,d,e,f,g) EXT MGVTBL var
+# define MGVTBL_SET_CONST_MAGIC_GET(var,a,b,c,d,e,f,g) EXT MGVTBL var
#endif
MGVTBL_SET(
diff --git a/pod/perlapi.pod b/pod/perlapi.pod
index 933b2aa99e..5d807df536 100644
--- a/pod/perlapi.pod
+++ b/pod/perlapi.pod
@@ -5092,7 +5092,7 @@ to contain an C<SV*> and is stored as-is with its REFCNT incremented.
(This is now used as a subroutine by C<sv_magic>.)
- MAGIC * sv_magicext(SV* sv, SV* obj, int how, const MGVTBL *vtbl, const char* name, I32 namlen)
+ MAGIC * sv_magicext(SV* sv, SV* obj, int how, MGVTBL *vtbl, const char* name, I32 namlen)
=for hackers
Found in file sv.c
diff --git a/proto.h b/proto.h
index d80f969c56..f401ade66f 100644
--- a/proto.h
+++ b/proto.h
@@ -2190,7 +2190,7 @@ PERL_CALLCONV STRLEN Perl_sv_len_utf8(pTHX_ SV* sv);
PERL_CALLCONV void Perl_sv_magic(pTHX_ SV* sv, SV* obj, int how, const char* name, I32 namlen)
__attribute__nonnull__(pTHX_1);
-PERL_CALLCONV MAGIC * Perl_sv_magicext(pTHX_ SV* sv, SV* obj, int how, const MGVTBL *vtbl, const char* name, I32 namlen)
+PERL_CALLCONV MAGIC * Perl_sv_magicext(pTHX_ SV* sv, SV* obj, int how, MGVTBL *vtbl, const char* name, I32 namlen)
__attribute__nonnull__(pTHX_1);
PERL_CALLCONV SV* Perl_sv_mortalcopy(pTHX_ SV* oldsv)
diff --git a/sv.c b/sv.c
index 6c884b04f9..60237b666a 100644
--- a/sv.c
+++ b/sv.c
@@ -4060,7 +4060,7 @@ to contain an C<SV*> and is stored as-is with its REFCNT incremented.
=cut
*/
MAGIC *
-Perl_sv_magicext(pTHX_ SV* sv, SV* obj, int how, const MGVTBL *vtable,
+Perl_sv_magicext(pTHX_ SV* sv, SV* obj, int how, MGVTBL *vtable,
const char* name, I32 namlen)
{
dVAR;
@@ -4149,7 +4149,7 @@ void
Perl_sv_magic(pTHX_ register SV *sv, SV *obj, int how, const char *name, I32 namlen)
{
dVAR;
- const MGVTBL *vtable;
+ MGVTBL *vtable;
MAGIC* mg;
#ifdef PERL_OLD_COPY_ON_WRITE