--- perlmulticore/perlmulticore.h 2015/07/02 22:39:56 1.1 +++ perlmulticore/perlmulticore.h 2015/08/14 14:51:23 1.4 @@ -15,11 +15,11 @@ =head1 NAME -perlmulticore.h - the Perl Multicore Specification and Implementation +perlmulticore.h - implements the Perl Multicore Specification =head1 SYNOPSIS - #include "perlmultiore.h" + #include "perlmulticore.h" // in your XS function: @@ -146,6 +146,8 @@ #else +START_EXTERN_C + /* this struct is shared between all modules, and currently */ /* contain only the two function pointers for release/acquire */ struct perl_multicore_api @@ -156,7 +158,8 @@ static void perl_multicore_init (void); -const struct perl_multicore_api perl_multicore_api_init = { perl_multicore_init, 0 }; +static const struct perl_multicore_api perl_multicore_api_init + = { perl_multicore_init, 0 }; static struct perl_multicore_api *perl_multicore_api = (struct perl_multicore_api *)&perl_multicore_api_init; @@ -170,6 +173,8 @@ { } +static const char perl_multicore_api_key[] = "perl_multicore_api"; + /* this is the initial implementation of "release" - it initialises */ /* the api and then calls the real release function */ static void @@ -178,7 +183,8 @@ dTHX; /* check for existing API struct in PL_modglobal */ - SV **api_svp = hv_fetch (PL_modglobal, "perl_multicore_api", sizeof ("perl_multicore_api") - 1, 1); + SV **api_svp = hv_fetch (PL_modglobal, perl_multicore_api_key, + sizeof (perl_multicore_api_key) - 1, 1); if (SvPOKp (*api_svp)) perl_multicore_api = (struct perl_multicore_api *)SvPVX (*api_svp); /* we have one, use the existing one */ @@ -198,6 +204,8 @@ perlinterp_release (); } +END_EXTERN_C + #endif #endif