pkgsrc-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: cross/mingw-w64 failed to compile on SunOS



On 19.01.2021 05:17, Hung Nguyen Gia wrote:
In file included from /usr/include/dlfcn.h:37,
                  from sysdep.h:80,
                  from deffilep.y:22:
deffilep.c:234:5: error: expected identifier before numeric constant
   234 |     SHARED = 279,
       |     ^~~~~~
deffilep.c:265: warning: "SHARED" redefined
   265 | #define SHARED 279
       |
In file included from /usr/include/dlfcn.h:37,
                  from sysdep.h:80,
                  from deffilep.y:22:
/usr/include/sys/mman.h:105: note: this is the location of the previous definition
   105 | #define SHARED  0x10

The error messages are quite clear in this case.

<sys/mman.h> defines the preprocessor macro SHARED to 0x10.

Since deffilep.c includes <sys/mman.h>, line 234 reads now:

    0x10 = 279

This doesn't make sense of course since an enumerator declaration must
have a _name_, not a _number_, on the left-hand side of the '='.

Later, deffilep.c redefines the preprocessor macro SHARED to 279, which
adds an inconsistency.

To fix this, either rename the token SHARED in deffilep.c or have a look
at /usr/include/sys/mman.h to see in which circumstances the macro
SHARED gets defined, and whether you can avoid that.  You cannot have
both definitions for SHARED at the same time, since they contradict each
other.

Roland


Home | Main Index | Thread Index | Old Index