Hi Rainer,

Thank you for the patch.

I think it looks good and indeed fixes the issue, but I think what we should really have here is an enum class instead and a different case for the variants - it would also align more closely with the refactors we've been doing recently.

If you're happy to wait I'll do a fix today and will upstream it to trunk this week.

Best,

Arthur

On 5/17/26 11:24 AM, Rainer Orth wrote:
When switching g++ to the default Solaris 11.4 compilation environment,
XPG7 + extensions, the rust frontend fails to compile:

<sys/mman.h> defines

#define PRIVATE         0x20

for the benefit of the Solaris-specific memcntl(2).  This was previously
hidden since g++ defined _XOPEN_SOURCE=600.

However, the issue has always been present for C:

#include <sys/mman.h>

enum vis
{
   PRIVATE
};

mp.c:5:3: error: expected identifier before numeric constant
     5 |   PRIVATE
       |   ^~~~~~~

While I'm the first to admit that such a generic identifier is highly
unfortunate, this is also true for the Rust front end.  The interface
goes all the way back to Solaris 1.0/SunOS 4, thus isn't going to
change.

Fixed by renaming PRIVATE to HIR_VIS_PRIVATE.  Same for the rest of enum
VisType.

Bootstrapped without regressions on amd64-pc-solaris2.11.

Ok for trunk?

        Rainer


Attachment: OpenPGP_0x1B3465B044AD9C65.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature.asc
Description: OpenPGP digital signature

Reply via email to