new IF_HAVE_PERL_5_16 convenience macro
[p5sagit/Function-Parameters.git] / toke_on_crack.c.inc
index 325ed72..bd609eb 100644 (file)
@@ -68,11 +68,10 @@ static char *S_scan_str(pTHX_ SV *sv, int keep_quoted, int keep_delims) {
                termlen = 1;
        }
        else {
-#if HAVE_PERL_VERSION(5, 16, 0)
-               termcode = utf8_to_uvchr_buf((U8*)s, (U8*)PL_bufend, &termlen);
-#else
-               termcode = utf8_to_uvchr((U8*)s, &termlen);
-#endif
+               termcode = IF_HAVE_PERL_5_16(
+                       utf8_to_uvchr_buf((U8*)s, (U8*)PL_bufend, &termlen),
+                       utf8_to_uvchr((U8*)s, &termlen)
+               );
                Copy(s, termstr, termlen, U8);
                if (!UTF8_IS_INVARIANT(term))
                        has_utf8 = TRUE;
@@ -111,10 +110,11 @@ static char *S_scan_str(pTHX_ SV *sv, int keep_quoted, int keep_delims) {
                                char * const svlast = SvEND(sv) - 1;
 
                                for (; s < ns; s++) {
-                                       if (*s == '\n' && !PL_rsfp
-#if HAVE_PERL_VERSION(5, 16, 0)
-                                               && !PL_parser->filtered
-#endif
+                                       if (*s == '\n' && !PL_rsfp &&
+                                               IF_HAVE_PERL_5_16(
+                                                       !PL_parser->filtered,
+                                                       TRUE
+                                               )
                                        )
                                                CopLINE_inc(PL_curcop);
                                }
@@ -182,10 +182,11 @@ static char *S_scan_str(pTHX_ SV *sv, int keep_quoted, int keep_delims) {
                if (PL_multi_open == PL_multi_close) {
                        for (; s < PL_bufend; s++,to++) {
                                /* embedded newlines increment the current line number */
-                               if (*s == '\n' && !PL_rsfp
-#if HAVE_PERL_VERSION(5, 16, 0)
-                                       && !PL_parser->filtered
-#endif
+                               if (*s == '\n' && !PL_rsfp &&
+                                       IF_HAVE_PERL_5_16(
+                                               !PL_parser->filtered,
+                                               1
+                                       )
                                )
                                        CopLINE_inc(PL_curcop);
                                /* handle quoted delimiters */
@@ -218,10 +219,11 @@ static char *S_scan_str(pTHX_ SV *sv, int keep_quoted, int keep_delims) {
                        /* read until we run out of string, or we find the terminator */
                        for (; s < PL_bufend; s++,to++) {
                                /* embedded newlines increment the line count */
-                               if (*s == '\n' && !PL_rsfp
-#if HAVE_PERL_VERSION(5, 16, 0)
-                                       && !PL_parser->filtered
-#endif
+                               if (*s == '\n' && !PL_rsfp &&
+                                       IF_HAVE_PERL_5_16(
+                                               !PL_parser->filtered,
+                                               1
+                                       )
                                )
                                        CopLINE_inc(PL_curcop);
                                /* backslashes can escape the open or closing characters */