Algorithm-AM

 view release on metacpan or  search on metacpan

ppport.h  view on Meta::CPAN

access to a large part of the Perl API that hasn't been available in
earlier Perl releases. Use

    perl ppport.h --list-provided

to see which API elements are provided by ppport.h.

=item *

You should avoid using deprecated parts of the API. For example, using
global Perl variables without the C<PL_> prefix is deprecated. Also,
some API functions used to have a C<perl_> prefix. Using this form is
also deprecated. You can safely use the supported API, as F<ppport.h>
will provide wrappers for older Perl versions.

=item *

Although the purpose of F<ppport.h> is to keep you from having to concern
yourself with what version you are running under, there may arise instances
where you have to do so.  These macros, the same ones as in base Perl, are
available to you in all versions, and are what you should use:

ppport.h  view on Meta::CPAN


If you use one of a few functions or variables that were not present in
earlier versions of Perl, and that can't be provided using a macro, you
have to explicitly request support for these functions by adding one or
more C<#define>s in your source code before the inclusion of F<ppport.h>.

These functions or variables will be marked C<explicit> in the list shown
by C<--list-provided>.

Depending on whether you module has a single or multiple files that
use such functions or variables, you want either C<static> or global
variants.

For a C<static> function or variable (used only in a single source
file), use:

    #define NEED_function
    #define NEED_variable

For a global function or variable (used in multiple source files),
use:

    #define NEED_function_GLOBAL
    #define NEED_variable_GLOBAL

Note that you mustn't have more than one global request for the
same function or variable in your project.

    Function / Variable       Static Request               Global Request
    -----------------------------------------------------------------------------------------
    caller_cx()               NEED_caller_cx               NEED_caller_cx_GLOBAL
    ck_warner()               NEED_ck_warner               NEED_ck_warner_GLOBAL
    ck_warner_d()             NEED_ck_warner_d             NEED_ck_warner_d_GLOBAL
    croak_xs_usage()          NEED_croak_xs_usage          NEED_croak_xs_usage_GLOBAL
    die_sv()                  NEED_die_sv                  NEED_die_sv_GLOBAL
    eval_pv()                 NEED_eval_pv                 NEED_eval_pv_GLOBAL

ppport.h  view on Meta::CPAN

    # Returns a floating point representation of the input version

    my $version = int_parse_version(shift);
    $version =~ s/ ^  ( $r_pat ) \B /$1./x;
    return $version;
}

BEGIN {
  if ("$]" < "5.006" ) {
    # On early perls, the implicit pass by reference doesn't work, so we have
    # to use the globals to initialize.
    eval q[sub dictionary_order($$) { _dictionary_order($a, $b) } ];
  } elsif ("$]" < "5.022" ) {
    eval q[sub dictionary_order($$) { _dictionary_order(@_) } ];
  } else {
    eval q[sub dictionary_order :prototype($$) { _dictionary_order(@_) } ];
  }
}

sub _dictionary_order { # Sort caselessly, ignoring punct
    my ($valid_a, $valid_b) = @_;

ppport.h  view on Meta::CPAN

ASCII_RESTRICT_PAT_MOD|5.013009||Viu
ASCII_RESTRICT_PAT_MODS|5.013009||Viu
ASCII_TO_NATIVE|5.007001||Viu
ASCII_TO_NEED|5.019004||dcVnu
asctime|5.009000||Viu
ASCTIME_R_PROTO|5.008000|5.008000|Vn
assert|5.003007||Viu
__ASSERT_|5.019007|5.008008|p
ASSERT_CURPAD_ACTIVE|5.008001||Viu
ASSERT_CURPAD_LEGAL|5.008001||Viu
assert_not_glob|5.009004||Viu
assert_not_ROK|5.008001||Viu
assert_uft8_cache_coherent|5.013003||Viu
assignment_type|5.021005||Viu
ASSUME|5.019006||Viu
atfork_lock|5.007002|5.007002|nu
atfork_unlock|5.007002|5.007002|nu
aTHX_|5.006000|5.003007|p
aTHX|5.006000|5.003007|p
aTHXa|5.017006||Viu
aTHXo|5.006000||Viu

ppport.h  view on Meta::CPAN

G_EVAL|5.003007|5.003007|
G_FAKINGEVAL|5.009004||Viu
Gid_t|5.003007|5.003007|Vn
Gid_t_f|5.006000|5.006000|Vn
Gid_t_sign|5.006000|5.006000|Vn
Gid_t_size|5.006000|5.006000|Vn
GIMME|5.003007|5.003007|d
GIMME_V|5.004000|5.004000|
gimme_V|5.031005||xcVu
G_KEEPERR|5.003007|5.003007|
glob_2number|5.009004||Viu
GLOBAL_PAT_MOD|5.009005||Viu
glob_assign_glob|5.009004||Viu
G_METHOD|5.006001|5.003007|p
G_METHOD_NAMED|5.019002|5.019002|
gmtime|5.031010||Viu
GMTIME_MAX|5.010001|5.010001|Vn
GMTIME_MIN|5.010001|5.010001|Vn
GMTIME_R_PROTO|5.008000|5.008000|Vn
G_NOARGS|5.003007|5.003007|
G_NODEBUG|5.004005||Viu
GOSUB|5.009005||Viu
gp_dup|5.007003|5.007003|u

ppport.h  view on Meta::CPAN

KEY_getpwent|5.003007||Viu
KEY_getpwnam|5.003007||Viu
KEY_getpwuid|5.003007||Viu
KEY_getservbyname|5.003007||Viu
KEY_getservbyport|5.003007||Viu
KEY_getservent|5.003007||Viu
KEY_getsockname|5.003007||Viu
KEY_getsockopt|5.003007||Viu
KEY_getspnam|5.031010||Viu
KEY_given|5.009003||Viu
KEY_glob|5.003007||Viu
KEY_gmtime|5.003007||Viu
KEY_goto|5.003007||Viu
KEY_grep|5.003007||Viu
KEY_gt|5.003007||Viu
KEY_hex|5.003007||Viu
KEY_if|5.003007||Viu
KEY_index|5.003007||Viu
KEY_INIT|5.005000||Viu
KEY_int|5.003007||Viu
KEY_ioctl|5.003007||Viu

ppport.h  view on Meta::CPAN

magic_setarylen|5.003007||Viu
magic_setcollxfrm|5.004000||Viu
magic_setdbline|5.003007||Viu
magic_setdebugvar|5.021005||Viu
magic_setdefelem|5.004000||Viu
magic_setenv|5.003007||Viu
magic_sethint|5.009004||Vi
magic_sethint_feature|5.031007||Viu
magic_setisa|5.003007||Viu
magic_setlvref|5.021005||Viu
magic_setmglob|5.003007||Viu
magic_setnkeys|5.003007||Viu
magic_setnonelem|5.027009||Viu
magic_setpack|5.003007||Viu
magic_setpos|5.003007||Viu
magic_setregexp|5.008001||Viu
magic_setsig|5.003007||Viu
magic_setsubstr|5.003007||Viu
magic_settaint|5.003007||Viu
magic_setutf8|5.008001||Viu
magic_setuvar|5.003007||Viu

ppport.h  view on Meta::CPAN

MgBYTEPOS_set|5.019004||Viu
mg_clear|5.003007|5.003007|
mg_copy|5.003007|5.003007|
mg_dup|5.007003|5.007003|u
MGf_BYTES|5.019004||Viu
MGf_COPY|5.007003||Viu
MGf_DUP|5.007003||Viu
MGf_GSKIP|5.003007||Viu
mg_find|5.003007|5.003007|n
mg_findext|5.013008|5.003007|pn
mg_find_mglob|5.019002||cViu
MGf_LOCAL|5.009003||Viu
MGf_MINMATCH|5.003007||Viu
MGf_PERSIST|5.021005||Viu
mg_free|5.003007|5.003007|
mg_freeext|5.027004|5.027004|
mg_free_type|5.013006|5.013006|
MGf_REFCOUNTED|5.003007||Viu
MGf_REQUIRE_GV|5.021004||Viu
MGf_TAINTEDDIR|5.003007||Viu
mg_get|5.003007|5.003007|

ppport.h  view on Meta::CPAN

PERL_MAGIC_checkcall|5.013006|5.013006|
PERL_MAGIC_collxfrm|5.007002|5.003007|p
PERL_MAGIC_dbfile|5.007002|5.003007|p
PERL_MAGIC_dbline|5.007002|5.003007|p
PERL_MAGIC_debugvar|5.021005|5.021005|
PERL_MAGIC_defelem|5.007002|5.003007|p
PERL_MAGIC_env|5.007002|5.003007|p
PERL_MAGIC_envelem|5.007002|5.003007|p
PERL_MAGIC_ext|5.007002|5.003007|p
PERL_MAGIC_fm|5.007002|5.003007|p
PERL_MAGIC_glob||5.003007|ponu
PERL_MAGIC_hints|5.009004|5.009004|
PERL_MAGIC_hintselem|5.009004|5.009004|
PERL_MAGIC_isa|5.007002|5.003007|p
PERL_MAGIC_isaelem|5.007002|5.003007|p
PERL_MAGIC_lvref|5.021005|5.021005|
PERL_MAGIC_mutex||5.003007|ponu
PERL_MAGIC_nkeys|5.007002|5.003007|p
PERL_MAGIC_nonelem|5.027009|5.027009|
PERL_MAGIC_overload||5.003007|ponu
PERL_MAGIC_overload_elem||5.003007|ponu
PERL_MAGIC_overload_table|5.007002|5.003007|p
PERL_MAGIC_pos|5.007002|5.003007|p
PERL_MAGIC_qr|5.007002|5.003007|p
PERL_MAGIC_READONLY_ACCEPTABLE|5.015000||Viu
PERL_MAGIC_regdata|5.007002|5.003007|p
PERL_MAGIC_regdatum|5.007002|5.003007|p
PERL_MAGIC_regex_global|5.007002|5.003007|p
PERL_MAGIC_rhash|5.009003|5.009003|
PERL_MAGIC_shared|5.007003|5.003007|p
PERL_MAGIC_shared_scalar|5.007003|5.003007|p
PERL_MAGIC_sig|5.007002|5.003007|p
PERL_MAGIC_sigelem|5.007002|5.003007|p
PERL_MAGIC_substr|5.007002|5.003007|p
PERL_MAGIC_sv|5.007002|5.003007|p
PERL_MAGIC_symtab|5.009003|5.009003|
PERL_MAGIC_taint|5.007002|5.003007|p
PERL_MAGIC_tied|5.007002|5.003007|p

ppport.h  view on Meta::CPAN

PL_exitlistlen|5.005000||Viu
PL_expect||5.003007|ponu
PL_fdpid|5.005000||Viu
PL_filemode|5.005000||Viu
PL_firstgv|5.005000||Viu
PL_forkprocess|5.005000||Viu
PL_formtarget|5.005000||Viu
PL_GCB_invlist|5.021009||Viu
PL_generation|5.005000||Viu
PL_gensym|5.005000||Viu
PL_globalstash|5.005000||Viu
PL_globhook|5.015005||Viu
PL_hash_rand_bits|5.017010||Viu
PL_HASH_RAND_BITS_ENABLED|5.018000||Viu
PL_hash_rand_bits_enabled|5.018000||Viu
PL_HasMultiCharFold|5.017005||Viu
PL_hexdigit||5.003007|pn
PL_hintgv|5.005000||Viu
PL_hints|5.005000|5.003007|poVnu
PL_hv_fetch_ent_mh|5.005000||Viu
PL_incgv|5.005000||Viu
PL_in_clean_all|5.005000||Viu

ppport.h  view on Meta::CPAN

PL_mess_sv|5.005000|5.004000|poVnu
PL_min_intro_pending|5.005000||Viu
PL_minus_a|5.005000||Viu
PL_minus_c|5.005000||Viu
PL_minus_E|5.009003||Viu
PL_minus_F|5.005000||Viu
PL_minus_l|5.005000||Viu
PL_minus_n|5.005000||Viu
PL_minus_p|5.005000||Viu
PL_modcount|5.005000||Viu
PL_modglobal|5.005000|5.005000|
PL_multideref_pc|5.021007||Viu
PL_my_cxt_list|5.009003||Viu
PL_my_cxt_size|5.009003||Viu
PL_na|5.004005|5.003007|p
PL_nomemok|5.005000||Viu
PL_no_modify||5.003007|ponu
PL_numeric_name|5.005000||Viu
PL_numeric_radix_sv|5.007002||Viu
PL_numeric_standard|5.005000||Viu
PL_numeric_underlying|5.027006||Viu

ppport.h  view on Meta::CPAN

PL_vtbl_debugvar|5.021005||Viu
PL_vtbl_defelem|5.015000||Viu
PL_vtbl_env|5.015000||Viu
PL_vtbl_envelem|5.015000||Viu
PL_vtbl_fm|5.015000||Viu
PL_vtbl_hints|5.015000||Viu
PL_vtbl_hintselem|5.015000||Viu
PL_vtbl_isa|5.015000||Viu
PL_vtbl_isaelem|5.015000||Viu
PL_vtbl_lvref|5.021005||Viu
PL_vtbl_mglob|5.015000||Viu
PL_vtbl_nkeys|5.015000||Viu
PL_vtbl_nonelem|5.027009||Viu
PL_vtbl_ovrld|5.015000||Viu
PL_vtbl_pack|5.015000||Viu
PL_vtbl_packelem|5.015000||Viu
PL_vtbl_pos|5.015000||Viu
PL_vtbl_regdata|5.015000||Viu
PL_vtbl_regdatum|5.015000||Viu
PL_vtbl_regexp|5.015000||Viu
PL_vtbl_sigelem|5.015000||Viu

ppport.h  view on Meta::CPAN

STADTX_K2_U64|5.027001||Viu
STADTX_K3_U32|5.027001||Viu
STADTX_K3_U64|5.027001||Viu
STADTX_K4_U32|5.027001||Viu
STADTX_K5_U32|5.027001||Viu
STADTX_SCRAMBLE64|5.027001||Viu
STADTX_STATIC_INLINE|5.027001||Viu
STANDARD_C|5.003007||Viu
STAR|5.003007||Viu
START_EXTERN_C|5.005000|5.003007|pV
start_glob|||xi
START_MY_CXT|5.010000|5.010000|p
STARTPERL|5.003007|5.003007|Vn
start_subparse|5.004000|5.003007|pu
StashHANDLER|5.007001||Viu
Stat|5.003007||Viu
stat|5.005000||Viu
STATIC|5.005000||Viu
STATIC_ASSERT_1|5.021007||Viu
STATIC_ASSERT_2|5.021007||Viu
STATIC_ASSERT_DECL|5.027001||Viu

ppport.h  view on Meta::CPAN

sv_len_utf8|5.006000|5.006000|p
sv_len_utf8_nomg|5.017004|5.006000|poViu
SvLENx|5.003007||Viu
SvLOCK|5.007003|5.007003|
sv_magic|5.003007|5.003007|
SvMAGIC|5.003007||Viu
SvMAGICAL|5.003007||Viu
SvMAGICAL_off|5.003007||Viu
SvMAGICAL_on|5.003007||Viu
sv_magicext|5.007003|5.007003|
sv_magicext_mglob|5.019002||cViu
sv_magic_portable||5.004000|pou
SvMAGIC_set|5.009003|5.003007|p
sv_mortalcopy|5.003007|5.003007|
sv_mortalcopy_flags|5.017005|5.003007|p
SV_MUTABLE_RETURN|5.009003|5.003007|poVnu
sv_ncmp|5.009003||Viu
sv_ncmp_desc|5.031010||Viu
sv_newmortal|5.003007|5.003007|
sv_newref|5.003007||cV
SvNIOK|5.003007|5.003007|

ppport.h  view on Meta::CPAN

SvTRUE_nomg|5.013006|5.003007|p
SvTRUE_nomg_NN|5.017007|5.017007|
SvTRUEx|5.003007|5.003007|
SvTRUEx_nomg|5.017002||Viu
SVt_RV|5.011000||Viu
svtype||5.003007|
SvTYPE|5.003007|5.003007|
SVTYPEMASK|5.003007||Viu
SvUID|5.019001||Viu
SV_UNDEF_RETURNS_NULL|5.011000||Viu
sv_unglob|5.005000||Viu
sv_uni_display|5.007003|5.007003|
SvUNLOCK|5.007003|5.007003|
sv_unmagic|5.003007|5.003007|
sv_unmagicext|5.013008|5.003007|p
sv_unref|5.003007|5.003007|
sv_unref_flags|5.007001|5.007001|
sv_untaint|5.004000||cV
SvUOK|5.007001|5.006000|p
SvUOK_nog|5.017002||Viu
SvUOK_nogthink|5.017002||Viu

ppport.h  view on Meta::CPAN

sv_vsetpvf|5.006000|5.004000|p
sv_vsetpvf_mg|5.006000|5.004000|p
sv_vsetpvfn|5.004000|5.004000|
SvVSTRING_mg|5.009004|5.003007|p
SvWEAKREF|5.006000||Viu
SvWEAKREF_off|5.006000||Viu
SvWEAKREF_on|5.006000||Viu
swallow_bom|5.006001||Viu
switch_category_locale_to_template|5.027009||Viu
SWITCHSTACK|5.003007||Viu
switch_to_global_locale|5.027009|5.003007|pn
sync_locale|5.027009|5.003007|pn
sys_init3|||cnu
sys_init|||cnu
sys_intern_clear|5.006001||Vu
sys_intern_dup|5.006000||Vu
sys_intern_init|5.006001||Vu
SYSTEM_GMTIME_MAX|5.011000||Viu
SYSTEM_GMTIME_MIN|5.011000||Viu
SYSTEM_LOCALTIME_MAX|5.011000||Viu
SYSTEM_LOCALTIME_MIN|5.011000||Viu

ppport.h  view on Meta::CPAN

VTBL_amagic|5.005003||Viu
VTBL_amagicelem|5.005003||Viu
VTBL_arylen|5.005003||Viu
VTBL_bm|5.005003||Viu
VTBL_collxfrm|5.005003||Viu
VTBL_dbline|5.005003||Viu
VTBL_defelem|5.005003||Viu
VTBL_env|5.005003||Viu
VTBL_envelem|5.005003||Viu
VTBL_fm|5.005003||Viu
VTBL_glob|5.005003||Viu
VTBL_isa|5.005003||Viu
VTBL_isaelem|5.005003||Viu
VTBL_mglob|5.005003||Viu
VTBL_nkeys|5.005003||Viu
VTBL_pack|5.005003||Viu
VTBL_packelem|5.005003||Viu
VTBL_pos|5.005003||Viu
VTBL_regdata|5.006000||Viu
VTBL_regdatum|5.006000||Viu
VTBL_regexp|5.005003||Viu
VTBL_sigelem|5.005003||Viu
VTBL_substr|5.005003||Viu
VTBL_sv|5.005003||Viu

ppport.h  view on Meta::CPAN

if (@ARGV) {
  my %seen;
  for (@ARGV) {
    if (-e) {
      if (-f) {
        push @files, $_ unless $seen{$_}++;
      }
      else { warn "'$_' is not a file.\n" }
    }
    else {
      my @new = grep { -f } glob $_
          or warn "'$_' does not exist.\n";
      push @files, grep { !$seen{$_}++ } @new;
    }
  }
}
else {
  eval {
    require File::Find;
    File::Find::find(sub {
      $File::Find::name =~ /($srcext)$/i
          and push @files, $File::Find::name;
    }, '.');
  };
  if ($@) {
    @files = map { glob "*$_" } @srcext;
  }
}

if (!@ARGV || $opt{filter}) {
  my(@in, @out);
  my %xsc = map { /(.*)\.xs$/ ? ("$1.c" => 1, "$1.cc" => 1) : () } @files;
  for (@files) {
    my $out = exists $xsc{$_} || /\b\Q$ppport\E$/i || !/($srcext)$/i;
    push @{ $out ? \@out : \@in }, $_;
  }
  if (@ARGV && @out) {
    warning("Skipping the following files (use --nofilter to avoid this):\n| ", join "\n| ", @out);
  }
  @files = @in;
}

die "No input files given!\n" unless @files;

my(%files, %global, %revreplace);
%revreplace = reverse %replace;
my $filename;
my $patch_opened = 0;

for $filename (@files) {
  unless (open IN, "<$filename") {
    warn "Unable to read from $filename: $!\n";
    next;
  }

ppport.h  view on Meta::CPAN

      {
        if ($c =~ /\b$func\b/) {
          $file{uses_todo}{$func}++;
        }
      }
    }
  }

  while ($c =~ /^$HS*#$HS*define$HS+(NEED_(\w+?)(_GLOBAL)?)\b/mg) {
    if (exists $need{$2}) {
      $file{defined $3 ? 'needed_global' : 'needed_static'}{$2}++;
    }
    else { warning("Possibly wrong #define $1 in $filename") }
  }

  for (qw(uses needs uses_todo needed_global needed_static)) {
    for $func (keys %{$file{$_}}) {
      push @{$global{$_}{$func}}, $filename;
    }
  }

  $files{$filename} = \%file;
}

# Globally resolve NEED_'s
my $need;
for $need (keys %{$global{needs}}) {
  if (@{$global{needs}{$need}} > 1) {
    my @targets = @{$global{needs}{$need}};
    my @t = grep $files{$_}{needed_global}{$need}, @targets;
    @targets = @t if @t;
    @t = grep /\.xs$/i, @targets;
    @targets = @t if @t;
    my $target = shift @targets;
    $files{$target}{needs}{$need} = 'global';
    for (@{$global{needs}{$need}}) {
      $files{$_}{needs}{$need} = 'extern' if $_ ne $target;
    }
  }
}

for $filename (@files) {
  exists $files{$filename} or next;

  info("=== Analyzing $filename ===");

ppport.h  view on Meta::CPAN

      $warnings++;
    }
  }

  for $func (sort dictionary_order keys %{$file{needed_static}}) {
    my $message = '';
    if (not exists $file{uses}{$func}) {
      $message = "No need to define NEED_$func if $func is never used";
    }
    elsif (exists $file{needs}{$func} && $file{needs}{$func} ne 'static') {
      $message = "No need to define NEED_$func when already needed globally";
    }
    if ($message) {
      diag($message);
      $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_$func\b.*$LF//mg);
    }
  }

  for $func (sort dictionary_order keys %{$file{needed_global}}) {
    my $message = '';
    if (not exists $global{uses}{$func}) {
      $message = "No need to define NEED_${func}_GLOBAL if $func is never used";
    }
    elsif (exists $file{needs}{$func}) {
      if ($file{needs}{$func} eq 'extern') {
        $message = "No need to define NEED_${func}_GLOBAL when already needed globally";
      }
      elsif ($file{needs}{$func} eq 'static') {
        $message = "No need to define NEED_${func}_GLOBAL when only used in this file";
      }
    }
    if ($message) {
      diag($message);
      $file{changes} += ($c =~ s/^$HS*#$HS*define$HS+NEED_${func}_GLOBAL\b.*$LF//mg);
    }
  }

  $file{needs_inc_ppport} = keys %{$file{uses}};

  if ($file{needs_inc_ppport}) {
    my $pp = '';

    for $func (sort dictionary_order keys %{$file{needs}}) {
      my $type = $file{needs}{$func};
      next if $type eq 'extern';
      my $suffix = $type eq 'global' ? '_GLOBAL' : '';
      unless (exists $file{"needed_$type"}{$func}) {
        if ($type eq 'global') {
          diag("Files [@{$global{needs}{$func}}] need $func, adding global request");
        }
        else {
          diag("File needs $func, adding static request");
        }
        $pp .= "#define NEED_$func$suffix\n";
      }
    }

    if ($pp && ($c =~ s/^(?=$HS*#$HS*define$HS+NEED_\w+)/$pp/m)) {
      $pp = '';

ppport.h  view on Meta::CPAN

#endif

#ifndef PERL_MAGIC_envelem
#  define PERL_MAGIC_envelem             'e'
#endif

#ifndef PERL_MAGIC_fm
#  define PERL_MAGIC_fm                  'f'
#endif

#ifndef PERL_MAGIC_regex_global
#  define PERL_MAGIC_regex_global        'g'
#endif

#ifndef PERL_MAGIC_isa
#  define PERL_MAGIC_isa                 'I'
#endif

#ifndef PERL_MAGIC_isaelem
#  define PERL_MAGIC_isaelem             'i'
#endif

ppport.h  view on Meta::CPAN

#endif

#ifndef PERL_MAGIC_substr
#  define PERL_MAGIC_substr              'x'
#endif

#ifndef PERL_MAGIC_defelem
#  define PERL_MAGIC_defelem             'y'
#endif

#ifndef PERL_MAGIC_glob
#  define PERL_MAGIC_glob                '*'
#endif

#ifndef PERL_MAGIC_arylen
#  define PERL_MAGIC_arylen              '#'
#endif

#ifndef PERL_MAGIC_pos
#  define PERL_MAGIC_pos                 '.'
#endif

ppport.h  view on Meta::CPAN

 * right after the definition (i.e. at file scope).  The non-threads
 * case below uses it to declare the data as static. */
#define START_MY_CXT

#if (PERL_BCDVERSION < 0x5004068)
/* Fetches the SV that keeps the per-interpreter data. */
#define dMY_CXT_SV \
        SV *my_cxt_sv = get_sv(MY_CXT_KEY, FALSE)
#else /* >= perl5.004_68 */
#define dMY_CXT_SV \
        SV *my_cxt_sv = *hv_fetch(PL_modglobal, MY_CXT_KEY,             \
                                  sizeof(MY_CXT_KEY)-1, TRUE)
#endif /* < perl5.004_68 */

/* This declaration should be used within all functions that use the
 * interpreter-local data. */
#define dMY_CXT \
        dMY_CXT_SV;                                                     \
        my_cxt_t *my_cxtp = INT2PTR(my_cxt_t*,SvUV(my_cxt_sv))

/* Creates and zeroes the per-interpreter data.

ppport.h  view on Meta::CPAN


    if (SvTYPE(sv) < SVt_PVMG || !SvMAGIC(sv))
	return 0;
    mgp = &(SvMAGIC(sv));
    for (mg = *mgp; mg; mg = *mgp) {
	const MGVTBL* const virt = mg->mg_virtual;
	if (mg->mg_type == type && virt == vtbl) {
	    *mgp = mg->mg_moremagic;
	    if (virt && virt->svt_free)
		virt->svt_free(aTHX_ sv, mg);
	    if (mg->mg_ptr && mg->mg_type != PERL_MAGIC_regex_global) {
		if (mg->mg_len > 0)
		    Safefree(mg->mg_ptr);
		else if (mg->mg_len == HEf_SVKEY) /* Questionable on older perls... */
		    SvREFCNT_dec(MUTABLE_SV(mg->mg_ptr));
		else if (mg->mg_type == PERL_MAGIC_utf8)
		    Safefree(mg->mg_ptr);
            }
	    if (mg->mg_flags & MGf_REFCOUNTED)
		SvREFCNT_dec(mg->mg_obj);
	    Safefree(mg);

ppport.h  view on Meta::CPAN

/* The names of these changed in 5.28 */
#ifndef LOCK_LC_NUMERIC_STANDARD
#  define LOCK_LC_NUMERIC_STANDARD       LOCK_NUMERIC_STANDARD
#endif

#ifndef UNLOCK_LC_NUMERIC_STANDARD
#  define UNLOCK_LC_NUMERIC_STANDARD     UNLOCK_NUMERIC_STANDARD
#endif

/* If this doesn't exist, it's not needed, so is void noop */
#ifndef switch_to_global_locale
#  define switch_to_global_locale()
#endif

/* Originally, this didn't return a value, but in perls like that, the value
 * should always be TRUE.  Add a return to Perl_sync_locale() when it's
 * available.  And actually do a sync when its not, if locales are available on
 * this system. */
#ifdef sync_locale
#  if (PERL_BCDVERSION < 0x5027009)
#    if (PERL_BCDVERSION >= 0x5021003)
#      undef sync_locale



( run in 0.511 second using v1.01-cache-2.11-cpan-49f99fa48dc )