Permalink
Browse files

Fix build breakage caused by r1717474 in perl < 5.13.6 (mg_free_type(…

…) was added in 5.13.6).

Spotted by Rainer Jung <rainer.jung@kippdata.de>.

git-svn-id: https://svn.apache.org/repos/asf/perl/modperl/trunk@1777355 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information...
1 parent 1dcb97f commit f4d886fdf7d79d54a0647336b5623b840a053eab Steve Hay committed Jan 4, 2017
Showing with 8 additions and 0 deletions.
  1. +8 −0 src/modules/perl/modperl_env.c
@@ -670,7 +670,11 @@ void modperl_env_init(pTHX)
mg->mg_ptr, mg->mg_obj, mg->mg_flags);
/* Remove it */
+#if MP_PERL_VERSION_AT_LEAST(5, 13, 6)
mg_free_type((SV*)ENVHV, PERL_MAGIC_env);
+#else
+ mg_free((SV*)ENVHV);
+#endif
/* Add our version instead */
mg = sv_magicext((SV*)ENVHV, (SV*)NULL, PERL_MAGIC_env, &MP_vtbl_env, (char*)NULL, 0);
@@ -699,7 +703,11 @@ void modperl_env_unload(pTHX)
mg->mg_ptr, mg->mg_obj, mg->mg_flags);
/* Remove it */
+#if MP_PERL_VERSION_AT_LEAST(5, 13, 6)
mg_free_type((SV*)ENVHV, PERL_MAGIC_env);
+#else
+ mg_free((SV*)ENVHV);
+#endif
/* Restore perl's original version */
sv_magicext((SV*)ENVHV, (SV*)NULL, PERL_MAGIC_env, &PL_vtbl_env, (char*)NULL, 0);

0 comments on commit f4d886f

Please sign in to comment.