summaryrefslogtreecommitdiff
path: root/util.c
diff options
context:
space:
mode:
authorJarkko Hietaniemi <jhi@iki.fi>2007-02-19 21:41:07 +0200
committerSteve Peters <steve@fisharerojo.org>2007-02-19 20:51:10 +0000
commitbae1192d8838abbb774747207533573c1bc72f97 (patch)
tree3094225ad106e44d36de4623cef253bb1e02b4ee /util.c
parented756621b7e346dcad5b51c1e9d060d1fe530fae (diff)
downloadperl-bae1192d8838abbb774747207533573c1bc72f97.tar.gz
blead (honestly :-) g++ with -DPERL_GLOBAL_STRUCT_PRIVATE needs tweaking
Message-Id: <20070219174107.63EEB43A67@anubis.hut.fi> Plus a regen picked up changes in pod/perlapi.pod related to change #30347. p4raw-id: //depot/perl@30362
Diffstat (limited to 'util.c')
-rw-r--r--util.c27
1 files changed, 16 insertions, 11 deletions
diff --git a/util.c b/util.c
index d23dc8a8e3..3c5518339e 100644
--- a/util.c
+++ b/util.c
@@ -5158,13 +5158,14 @@ Perl_stashpv_hvname_match(pTHX_ const COP *c, const HV *hv)
#ifdef PERL_GLOBAL_STRUCT
+#define PERL_GLOBAL_STRUCT_INIT
+#include "opcode.h" /* the ppaddr and check */
+
struct perl_vars *
Perl_init_global_struct(pTHX)
{
struct perl_vars *plvarsp = NULL;
-#ifdef PERL_GLOBAL_STRUCT
-# define PERL_GLOBAL_STRUCT_INIT
-# include "opcode.h" /* the ppaddr and check */
+# ifdef PERL_GLOBAL_STRUCT
const IV nppaddr = sizeof(Gppaddr)/sizeof(Perl_ppaddr_t);
const IV ncheck = sizeof(Gcheck) /sizeof(Perl_check_t);
# ifdef PERL_GLOBAL_STRUCT_PRIVATE
@@ -5192,10 +5193,14 @@ Perl_init_global_struct(pTHX)
# undef PERLVARIC
# undef PERLVARISC
# ifdef PERL_GLOBAL_STRUCT
- plvarsp->Gppaddr = PerlMem_malloc(nppaddr * sizeof(Perl_ppaddr_t));
+ plvarsp->Gppaddr =
+ (Perl_ppaddr_t*)
+ PerlMem_malloc(nppaddr * sizeof(Perl_ppaddr_t));
if (!plvarsp->Gppaddr)
exit(1);
- plvarsp->Gcheck = PerlMem_malloc(ncheck * sizeof(Perl_check_t));
+ plvarsp->Gcheck =
+ (Perl_check_t*)
+ PerlMem_malloc(ncheck * sizeof(Perl_check_t));
if (!plvarsp->Gcheck)
exit(1);
Copy(Gppaddr, plvarsp->Gppaddr, nppaddr, Perl_ppaddr_t);
@@ -5204,8 +5209,8 @@ Perl_init_global_struct(pTHX)
# ifdef PERL_SET_VARS
PERL_SET_VARS(plvarsp);
# endif
-# undef PERL_GLOBAL_STRUCT_INIT
-#endif
+# undef PERL_GLOBAL_STRUCT_INIT
+# endif
return plvarsp;
}
@@ -5216,16 +5221,16 @@ Perl_init_global_struct(pTHX)
void
Perl_free_global_struct(pTHX_ struct perl_vars *plvarsp)
{
-#ifdef PERL_GLOBAL_STRUCT
+# ifdef PERL_GLOBAL_STRUCT
# ifdef PERL_UNSET_VARS
PERL_UNSET_VARS(plvarsp);
# endif
free(plvarsp->Gppaddr);
free(plvarsp->Gcheck);
-# ifdef PERL_GLOBAL_STRUCT_PRIVATE
+# ifdef PERL_GLOBAL_STRUCT_PRIVATE
free(plvarsp);
-# endif
-#endif
+# endif
+# endif
}
#endif /* PERL_GLOBAL_STRUCT */