5 # This allows the order of overloading constants to be changed.
9 # Get function prototypes
10 require 'regen_lib.pl';
19 my ($enum, $name) = /^(\S+)\s+(\S+)/ or die "Can't parse $_";
20 # No smart match in 5.8.x
21 next if $enum eq 'smart';
26 safer_unlink 'overload.h';
27 die "overload.h: $!" unless open(H, ">overload.h");
31 /* -*- buffer-read-only: t -*-
35 * Copyright (C) 1997, 1998, 2000, 2001, 2005 and 2006 by Larry Wall and
38 * You may distribute under the terms of either the GNU General Public
39 * License or the Artistic License, as specified in the README file.
41 * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
42 * This file is built by overload.pl
48 print " ${_}_amg,\n", foreach @enums;
52 /* Do not leave a trailing comma here. C9X allows it, C89 doesn't. */
56 #define NofAMmeth max_amg_code
57 #define AMG_id2name(id) (PL_AMG_names[id]+1)
60 EXTCONST char * const PL_AMG_names[NofAMmeth] = {
61 /* Names kept in the symbol table. fallback => "()", the rest has
62 "(" prepended. The only other place in perl which knows about
63 this convention is AMG_id2name (used for debugging output and
64 'nomethod' only), the only other place which has it hardwired is
68 my $last = pop @names;
69 print " \"$_\",\n" foreach map { s/(["\\"])/\\$1/g; $_ } @names;
75 EXTCONST char * PL_AMG_names[NofAMmeth];
76 #endif /* def INITAMAGIC */
82 # Fallback should be the first
85 # These 5 are the most common in the fallback switch statement in amagic_call
92 # These have non-default cases in that switch statement
105 # These 12 feature in the next switch statement
156 # Note: Perl_Gv_AMupdate() assumes that DESTROY is the last entry