BrowserUk has asked for the wisdom of the Perl Monks concerning the following question:

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."