Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix eval_pv for old compilers #217

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion parts/inc/call
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,8 @@ __UNDEFINED__ PERL_LOADMOD_IMPORT_OPS 0x4
#if defined(PERL_USE_GCC_BRACE_GROUPS)
# define D_PPP_CROAK_IF_ERROR(cond) ({ SV *_errsv; ((cond) && (_errsv = ERRSV) && (SvROK(_errsv) || SvTRUE(_errsv)) && (croak_sv(_errsv), 1)); })
#else
# define D_PPP_CROAK_IF_ERROR(cond) ((cond) && (SvROK(ERRSV) || SvTRUE(ERRSV)) && (croak_sv(ERRSV), 1))
PERL_STATIC_INLINE void D_PPP_CROAK_IF_ERROR(int cond) { dTHX; SV *errsv; if (!cond) return; errsv = ERRSV; if (SvROK(errsv) || SvTRUE(errsv)) croak_sv(errsv); }
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would adding an undef D_PPP_CROAK_IF_ERROR add some extra safety?

# define D_PPP_CROAK_IF_ERROR(cond) D_PPP_CROAK_IF_ERROR(cond)
#endif

#ifndef G_METHOD
Expand Down
7 changes: 7 additions & 0 deletions parts/inc/misc
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ MUTABLE_PTR
NVTYPE
PERLIO_FUNCS_CAST
PERLIO_FUNCS_DECL
PERL_STATIC_INLINE
PERL_UNUSED_ARG
PERL_UNUSED_CONTEXT
PERL_UNUSED_DECL
Expand All @@ -38,6 +39,12 @@ ASSUME

=implementation

#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
__UNDEFINED__ PERL_STATIC_INLINE static inline
#else
__UNDEFINED__ PERL_STATIC_INLINE static
#endif

__UNDEFINED__ cBOOL(cbool) ((cbool) ? (bool)1 : (bool)0)
__UNDEFINED__ OpHAS_SIBLING(o) (cBOOL((o)->op_sibling))
__UNDEFINED__ OpSIBLING(o) (0 + (o)->op_sibling)
Expand Down