Structure definition conflict between XS module and perl string

In OpenSolaris ($ ^ O eq 'solaris', version 2.11), I am trying to create an XS module that uses the XPGv4v2 / Single Unix specification. understanding struct msghdr, in particular, for polling “supporting data”.

However, the built-in perl (v5.8.4) was created without the necessary definitions, and therefore struct msghdr, visible in my XS file, is an older, BSD type:

#include "EXTERN.h"
#include "perl.h"      /* older, "msg_accrights"-style msghdr now visible */
#include "XSUB.h"

....
  struct msghdr m;
  m.msg_control = buf;  /* ERROR, structure has no member named "msg_control" */
....

"Right" delivery #define( _XOPEN_SOURCEand _XOPEN_SOURCE_EXTENDED) divides the assembly, because it changes a lot of things, the expected perl.

Is there an elegant way to force the XS module to use the structure definition that I would like?

+3
1

, perl , perl , .

perl. perl , .

, , Perl , . , . , , , , .: (

+2

Source: https://habr.com/ru/post/1729249/


All Articles