Ignore this: I found it in C:\Perl\lib\CORE\config.h:1274:#define VAL_O_NONBLOCK O_NONBLOCK

I read Net::Gen fails while using threads and decided to try and install Net::Gen (under win32). The attempt fell at the first hurdle with:

Gen.c Gen.xs(718) : warning C4101: 'adata' : unreferenced local variable Gen.xs(783) : error C2065: 'O_NONBLOCK' : undeclared identifier

Unsurprising perhaps, but still something about this is bugging me. Basically, I cannot work out how this from Gen.xs(781):

BOOT: #ifdef VAL_O_NONBLOCK newXSconstUV("Net::Gen::VAL_O_NONBLOCK", VAL_O_NONBLOCK, file); #else newmissing(missing, "Net::Gen::VAL_O_NONBLOCK", file); #endif

which becomes this in Gen.c(1079):

#line 782 "Gen.xs" #ifdef VAL_O_NONBLOCK newXSconstUV("Net::Gen::VAL_O_NONBLOCK", VAL_O_NONBLOCK, file); #else newmissing(missing, "Net::Gen::VAL_O_NONBLOCK", file); #endif

becomes this is the post preprocessed code seen by the compiler (Gen.E(115644)):

#line 782 "Gen.xs" S_newXSconstUV( ((PerlInterpreter *)pthread_getspecific((*Perl_Gthr_key_ptr +(0)))), "Net::Gen::VAL_O_NONBLOCK", O_NONBLOCK, file );

That is, how and where did VAL_O_NONBLOCK become translated to O_NONBLOCK?

And more importantly, how did you find it?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."

In reply to (XS) Teach an ol'dog a new trick? (Ignore:Found it!) by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.