summaryrefslogtreecommitdiff
path: root/perl.h
diff options
context:
space:
mode:
authorNicholas Clark <nick@ccl4.org>2004-06-15 09:21:22 +0000
committerNicholas Clark <nick@ccl4.org>2004-06-15 09:21:22 +0000
commit2b0572841e170b6dd3ff1e2adc09565a9efdf3f1 (patch)
tree183b281df6538aa9e2c95b55a3f193e98faade5f /perl.h
parentacf31ca582944c8bb9501bdc43ade24d8a322e8a (diff)
downloadperl-2b0572841e170b6dd3ff1e2adc09565a9efdf3f1.tar.gz
It seems that our assert() macro wasn't good enough.
Changed to one that that is an expression, rather than a statement. Fix new macros definitions in sv.h to be clean enough C to keep the AIX compiler happy. p4raw-id: //depot/perl@22937
Diffstat (limited to 'perl.h')
-rw-r--r--perl.h21
1 files changed, 6 insertions, 15 deletions
diff --git a/perl.h b/perl.h
index ba7e3dc8ba..93034190ec 100644
--- 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 {