This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
pp.c: Fix Win32 compilation problems
authorKarl Williamson <khw@cpan.org>
Thu, 12 Jun 2014 20:31:24 +0000 (14:31 -0600)
committerKarl Williamson <khw@cpan.org>
Thu, 12 Jun 2014 21:04:54 +0000 (15:04 -0600)
Commit 130c5df3625bd130cd1e2771308fcd4eb66cebb2 introduced errors into
Windows (at least) compilations because it used #if's in the middle of
apparent function calls, but these were really macros that turned the
function call foo() into a call of Perl_foo(), and so we were doing
an #if from within a #define which is not generally legal.

pp.c

diff --git a/pp.c b/pp.c
index e57f426..4146256 100644 (file)
--- a/pp.c
+++ b/pp.c
@@ -3514,22 +3514,18 @@ PP(pp_ucfirst)
        doing_utf8 = TRUE;
         ulen = UTF8SKIP(s);
         if (op_type == OP_UCFIRST) {
-           _to_utf8_title_flags(s, tmpbuf, &tculen,
 #ifdef USE_LOCALE_CTYPE
-                                                     IN_LC_RUNTIME(LC_CTYPE)
+           _to_utf8_title_flags(s, tmpbuf, &tculen, IN_LC_RUNTIME(LC_CTYPE));
 #else
-                                                     0
+           _to_utf8_title_flags(s, tmpbuf, &tculen, 0);
 #endif
-            );
        }
         else {
-           _to_utf8_lower_flags(s, tmpbuf, &tculen,
 #ifdef USE_LOCALE_CTYPE
-                                                     IN_LC_RUNTIME(LC_CTYPE)
+           _to_utf8_lower_flags(s, tmpbuf, &tculen, IN_LC_RUNTIME(LC_CTYPE));
 #else
-                                                     0
+           _to_utf8_lower_flags(s, tmpbuf, &tculen, 0);
 #endif
-            );
        }
 
         /* we can't do in-place if the length changes.  */
@@ -3816,13 +3812,11 @@ PP(pp_uc)
              * and copy it to the output buffer */
 
             u = UTF8SKIP(s);
-            uv = _to_utf8_upper_flags(s, tmpbuf, &ulen,
 #ifdef USE_LOCALE_CTYPE
-                                                        IN_LC_RUNTIME(LC_CTYPE)
+            uv = _to_utf8_upper_flags(s, tmpbuf, &ulen, IN_LC_RUNTIME(LC_CTYPE));
 #else
-                                                        0
+            uv = _to_utf8_upper_flags(s, tmpbuf, &ulen, 0);
 #endif
-            );
 #define GREEK_CAPITAL_LETTER_IOTA 0x0399
 #define COMBINING_GREEK_YPOGEGRAMMENI 0x0345
             if (uv == GREEK_CAPITAL_LETTER_IOTA
@@ -4033,13 +4027,11 @@ PP(pp_lc)
            const STRLEN u = UTF8SKIP(s);
            STRLEN ulen;
 
-           _to_utf8_lower_flags(s, tmpbuf, &ulen,
 #ifdef USE_LOCALE_CTYPE
-                                                   IN_LC_RUNTIME(LC_CTYPE)
+           _to_utf8_lower_flags(s, tmpbuf, &ulen, IN_LC_RUNTIME(LC_CTYPE));
 #else
-                                                   0
+           _to_utf8_lower_flags(s, tmpbuf, &ulen, 0);
 #endif
-            );
 
            /* Here is where we would do context-sensitive actions.  See the
             * commit message for 86510fb15 for why there isn't any */