develooper Front page | perl.wxperl.users | Postings from June 2017

[rt.cpan.org #121464] Compile fails with "error: expected identifierbefore string constant" from /CORE/unicode_constants.h

Thread Previous
From:
Petr Pisar via RT
Date:
June 7, 2017 14:46
Subject:
[rt.cpan.org #121464] Compile fails with "error: expected identifierbefore string constant" from /CORE/unicode_constants.h
Message ID:
rt-4.0.18-15042-1496846780-1626.121464-15-0@rt.cpan.org
Wed Jun 07 10:46:19 2017: Request 121464 was acted upon.
Transaction: Correspondence added by ppisar
       Queue: Wx
     Subject: Compile fails with "error: expected identifier before string constant" from /CORE/unicode_constants.h
   Broken in: (no value)
    Severity: (no value)
       Owner: Nobody
  Requestors: KENTNL@cpan.org
      Status: new
 Ticket <URL: https://rt.cpan.org/Ticket/Display.html?id=121464 >


Dne Ne 30.dub.2017 05:37:28, KENTNL napsal(a):
> In file included from
> /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-
> nodot/lib/5.25.12/x86_64-linux/CORE/utf8.h:30:0,
> from
> /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-
> nodot/lib/5.25.12/x86_64-linux/CORE/regexp.h:21,
> from
> /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-
> nodot/lib/5.25.12/x86_64-linux/CORE/perl.h:3914,
> from ../../cpp/wxapi.h:57,
> from RichText.c:23:
> /home/kent/perl5/perlbrew/perls/5.25.12-nossp-sip13-nopmc-
> nodot/lib/5.25.12/x86_64-linux/CORE/unicode_constants.h:72:22:
> error: expected identifier before string constant
> # define BOM_UTF8 "\xEF\xBB\xBF" /* U+FEFF */
> ^
> /usr/include/wx-2.8/wx/convauto.h:54:9: note: in expansion of macro
> ‘BOM_UTF8’
> BOM_UTF8
> ^

/usr/include/wx-2.8/wx/convauto.h Wx header file defines BOM_UTF8 enum value:

class WXDLLIMPEXP_BASE wxConvAuto : public wxMBConv
{
private:
    // all currently recognized BOM values
    enum BOMType
    {   
        BOM_None,
        BOM_UTF32BE,
        BOM_UTF32LE,
        BOM_UTF16BE,
        BOM_UTF16LE,
        BOM_UTF8
    };
}

While Perl's CORE/unicode_constants.h defines a same-named macro:

#   define BOM_UTF8  "\xEF\xBB\xBF"    /* U+FEFF */

String literals cannot be enum values.

Thread Previous


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