From: Nicholas Clark Date: Tue, 15 Nov 2011 18:44:18 +0000 (+0100) Subject: Tweak the cBOOL() macro to avoid problems with the AIX compiler. X-Git-Tag: accepted/trunk/20130322.191538~2102 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=18f5643bfee3e4c35fe1b510ad2e37dcb28b9efc;p=platform%2Fupstream%2Fperl.git Tweak the cBOOL() macro to avoid problems with the AIX compiler. (cherry picked from commit 0cebf65582f924952bfee1472749d442d51e43e6) --- diff --git a/handy.h b/handy.h index 2c2311a..8777644 100644 --- a/handy.h +++ b/handy.h @@ -115,9 +115,10 @@ Null SV pointer. (No longer available when C is defined.) /* a simple (bool) cast may not do the right thing: if bool is defined * as char for example, then the cast from int is implementation-defined + * (bool)!!(cbool) in a ternary triggers a bug in xlc on AIX */ -#define cBOOL(cbool) ((bool)!!(cbool)) +#define cBOOL(cbool) ((cbool) ? (bool)1 : (bool)0) /* Try to figure out __func__ or __FUNCTION__ equivalent, if any. * XXX Should really be a Configure probe, with HAS__FUNCTION__