regen/embed.pl: Don't: #define FOO FOO
authorKarl Williamson <khw@cpan.org>
Thu, 12 May 2016 17:31:10 +0000 (11:31 -0600)
committerKarl Williamson <khw@cpan.org>
Fri, 13 May 2016 02:19:59 +0000 (20:19 -0600)
Doing so would be useless.  This doesn't currently happen, but would in
a couple of commits.

regen/embed.pl

index e06d764..11b2e94 100755 (executable)
@@ -303,7 +303,9 @@ sub embed_h {
        unless ($flags =~ /[om]/) {
            my $args = scalar @args;
            if ($flags =~ /n/) {
-               $ret = hide($func, full_name($func, $flags));
+               my $full_name = full_name($func, $flags);
+               next if $full_name eq $func;    # Don't output a no-op.
+               $ret = hide($func, $full_name);
            }
            elsif ($args and $args[$args-1] =~ /\.\.\./) {
                if ($flags =~ /p/) {