Skip to content

Commit 5ffa89d

Browse files
committed
Cleanup Perl_assert definition
PERL_DEB2 is too obscure for me. Simply use #ifdef DEBUGGING
1 parent 1ad6eca commit 5ffa89d

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

perl.h

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5096,11 +5096,15 @@ Gid_t getegid (void);
50965096
/* Keep the old croak based assert for those who want it, and as a fallback if
50975097
the platform is so heretically non-ANSI that it can't assert. */
50985098

5099-
#define Perl_assert(what) PERL_DEB2( \
5100-
((what) ? ((void) 0) : \
5101-
(Perl_croak_nocontext("Assertion %s failed: file \"" __FILE__ \
5102-
"\", line %d", STRINGIFY(what), __LINE__), \
5103-
(void) 0)), ((void)0))
5099+
#ifdef DEBUGGING
5100+
# define Perl_assert(what) \
5101+
((what) \
5102+
? ((void) 0) \
5103+
: (Perl_croak_nocontext("Assertion %s failed: file \"" __FILE__ \
5104+
"\", line %d", STRINGIFY(what), __LINE__)
5105+
#else
5106+
# define Perl_assert(what) ((void) 0)
5107+
#endif
51045108

51055109
#ifndef assert
51065110
# define assert(what) Perl_assert(what)

0 commit comments

Comments
 (0)