/* 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__
* the function. This relies on the fact that ASCII characters have the same
* representation whether utf8 or not */
#define generic_utf8(macro, function, p) (isASCII(*(p)) \
- ? CAT2(macro, _A)(*(p)) \
+ ? CAT2(CAT2(macro,_),A)(*(p)) \
: (UTF8_IS_DOWNGRADEABLE_START(*(p))) \
? CAT2(macro, _L1) \
(TWO_BYTE_UTF8_TO_UNI(*(p), \
: (UTF8_IS_DOWNGRADEABLE_START(*(p))) \
? isIDFIRST_L1(TWO_BYTE_UTF8_TO_UNI(*(p), \
*((p)+1)))\
- : _is_utf8__perl_idstart(p))
+ : Perl__is_utf8__perl_idstart(aTHX_ p))
#define isIDCONT_utf8(p) generic_utf8(isWORDCHAR, is_utf8_xidcont, p)
#define isALPHA_utf8(p) generic_utf8(isALPHA, is_utf8_alpha, p)
#define isSPACE_utf8(p) generic_utf8(isSPACE, is_utf8_space, p)