develooper Front page | perl.libwin32 | Postings from November 2018

[rt.cpan.org #127836] Cygwin: wcslen(), wcscpy() called withoutbeing declared

From:
TONYC via RT
Date:
November 29, 2018 02:33
Subject:
[rt.cpan.org #127836] Cygwin: wcslen(), wcscpy() called withoutbeing declared
Message ID:
rt-4.0.18-16962-1543458791-1753.127836-15-0@rt.cpan.org
Wed Nov 28 21:33:11 2018: Request 127836 was acted upon.
Transaction: Ticket created by TONYC
       Queue: Win32
     Subject: Cygwin: wcslen(), wcscpy() called without being declared
   Broken in: (no value)
    Severity: (no value)
       Owner: Nobody
  Requestors: TONYC@cpan.org
      Status: new
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=127836 >


Win32.xs: In function ‘void w32_GetLongPathName(PerlInterpreter*, CV*)’:
Win32.xs:1528:13: error: ‘wcslen’ was not declared in this scope
         if (wcslen(wstr) < countof(wide_path)) {
             ^~~~~~
Win32.xs:1528:13: note: suggested alternative: ‘listen’
         if (wcslen(wstr) < countof(wide_path)) {
             ^~~~~~
             listen
Win32.xs:1529:13: error: ‘wcscpy’ was not declared in this scope
             wcscpy(wide_path, wstr);
             ^~~~~~
Win32.xs:1529:13: note: suggested alternative: ‘wctype’
             wcscpy(wide_path, wstr);
             ^~~~~~
             wctype

This causes the build to fail if perl is built with g++ on cygwin.

Adding:

  #include <wchar.h>

fixes the problem.

Tony



nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About