From 48d56f319200ba82bd7efd47ba0763f208c3fa04 Mon Sep 17 00:00:00 2001 From: Leon Timmermans Date: Wed, 15 Jan 2025 05:18:59 +0100 Subject: [PATCH] Prevent double definitions of vararg functions This fixes a flaw in 29b0ccbf86239e4f179d573e3465722f9c023e08 that causes warnings about these macros being redefined. --- embed.h | 6 ++++-- regen/embed.pl | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/embed.h b/embed.h index e4b4bb5e1cd9..1a828d41b7cd 100644 --- a/embed.h +++ b/embed.h @@ -76,7 +76,8 @@ extra argument but grab the context pointer using the macro dTHX. */ -# if defined(MULTIPLICITY) && !defined(PERL_NO_SHORT_NAMES) +# if defined(MULTIPLICITY) && !defined(PERL_NO_SHORT_NAMES) && \ + !defined(PERL_WANT_VARARGS) # define croak Perl_croak_nocontext # define deb Perl_deb_nocontext # define die Perl_die_nocontext @@ -90,7 +91,8 @@ # define sv_setpvf_mg Perl_sv_setpvf_mg_nocontext # define warn Perl_warn_nocontext # define warner Perl_warner_nocontext -# endif /* defined(MULTIPLICITY) && !defined(PERL_NO_SHORT_NAMES) */ +# endif /* defined(MULTIPLICITY) && !defined(PERL_NO_SHORT_NAMES) && + !defined(PERL_WANT_VARARGS) */ # endif /* !defined(PERL_NOCOMPAT) */ #endif /* !defined(PERL_CORE) */ #if !defined(PERL_NO_SHORT_NAMES) diff --git a/regen/embed.pl b/regen/embed.pl index 0c409204ffe3..abbee02401fe 100755 --- a/regen/embed.pl +++ b/regen/embed.pl @@ -651,7 +651,7 @@ sub generate_embed_h { provides a set of compatibility functions that don't take an extra argument but grab the context pointer using the macro dTHX. */ - #if defined(MULTIPLICITY) && !defined(PERL_NO_SHORT_NAMES) + #if defined(MULTIPLICITY) && !defined(PERL_NO_SHORT_NAMES) && !defined(PERL_WANT_VARARGS) END foreach (@nocontext) {