This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
It seems that our assert() macro wasn't good enough.
[perl5.git] / perl.h
diff --git a/perl.h b/perl.h
index ba7e3dc..9303419 100644 (file)
--- a/perl.h
+++ b/perl.h
@@ -2966,21 +2966,12 @@ Gid_t getegid (void);
 
 
 #ifndef assert  /* <assert.h> might have been included somehow */
-#ifdef DEBUGGING
-#define assert(what)   PERL_DEB( {                                     \
-       if (!(what)) {                                                  \
-           Perl_croak(aTHX_ "Assertion " STRINGIFY(what) " failed: file \"%s\", line %d",      \
-               __FILE__, __LINE__);                                    \
-           PerlProc_exit(1);                                           \
-       }})
-#else
-#define assert(what)   PERL_DEB( {                                     \
-       if (!(what)) {                                                  \
-           Perl_croak(aTHX_ "Assertion failed: file \"%s\", line %d",  \
-               __FILE__, __LINE__);                                    \
-           PerlProc_exit(1);                                           \
-       }})
-#endif
+#define assert(what)   PERL_DEB(                                       \
+       ((what) ? ((void) 0) :                                          \
+           (Perl_croak(aTHX_ "Assertion " STRINGIFY(what) " failed: file \"%s\", line %d",     \
+               __FILE__, __LINE__),                                    \
+           PerlProc_exit(1),                                           \
+           (void) 0)))
 #endif
 
 struct ufuncs {