Skip to content

Commit

Permalink
Prevent double definitions of vararg functions
Browse files Browse the repository at this point in the history
This fixes a flaw in 29b0ccb that
causes warnings about these macros being redefined.
  • Loading branch information
Leont committed Jan 15, 2025
1 parent 7a1c156 commit 48d56f3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 4 additions & 2 deletions embed.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion regen/embed.pl
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down

0 comments on commit 48d56f3

Please sign in to comment.