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 $_";
24 safer_unlink 'overload.h';
25 die "overload.h: $!" unless open(H, ">overload.h");
29 /* -*- buffer-read-only: t -*-
33 * Copyright (C) 1997, 1998, 2000, 2001, 2005, 2006, 2007 by Larry Wall
36 * You may distribute under the terms of either the GNU General Public
37 * License or the Artistic License, as specified in the README file.
39 * !!!!!!! DO NOT EDIT THIS FILE !!!!!!!
40 * This file is built by overload.pl
46 print " ${_}_amg,\n", foreach @enums;
50 /* Do not leave a trailing comma here. C9X allows it, C89 doesn't. */
54 #define NofAMmeth max_amg_code
55 #define AMG_id2name(id) (PL_AMG_names[id]+1)
58 EXTCONST char * const PL_AMG_names[NofAMmeth] = {
59 /* Names kept in the symbol table. fallback => "()", the rest has
60 "(" prepended. The only other place in perl which knows about
61 this convention is AMG_id2name (used for debugging output and
62 'nomethod' only), the only other place which has it hardwired is
66 my $last = pop @names;
67 print " \"$_\",\n" foreach map { s/(["\\"])/\\$1/g; $_ } @names;
73 EXTCONST char * PL_AMG_names[NofAMmeth];
74 #endif /* def INITAMAGIC */
80 # Fallback should be the first
83 # These 5 are the most common in the fallback switch statement in amagic_call
90 # These have non-default cases in that switch statement
103 # These 12 feature in the next switch statement
154 # Note: Perl_Gv_AMupdate() assumes that DESTROY is the last entry