Sisyphus wrote:
----- Original Message ----- From: "muppet" <[EMAIL PROTECTED]>
To: "Sisyphus" <[EMAIL PROTECTED]>
Cc: "xs" <perl-xs@perl.org>
Sent: Sunday, November 26, 2006 1:05 PM
Subject: Re: Determining OS type and perl version


On Nov 25, 2006, at 7:26 PM, Sisyphus wrote:

Hi,
Where do I find the definitions (assuming such exist) that I can
use to
determine from within an XSub:

1) The operating system in use (specifically, whether it's Cygwin);
2) The version of perl (specifically, whether it's >= 5.6.1);

In the past I've used the values of $] and $^O to DEFINE my own
symbols in
the Makefile.PL - which works fine, but is a little silly if the
info the
XSub needs is already available.
You can use those variables in XS the same as in perl code.

Sorry - I didn't specify it, but I was wanting to do it with the
pre-processor:

I think you can check for Cygwin with

#ifdef __CYGWIN__

and you can check the perl version using the defines

PERL_REVISION
PERL_VERSION
PERL_SUBVERSION

from perl's patchlevel.h

--


------------------------------------------------
Radan Computational Ltd.

The information contained in this message and any files transmitted with it are 
confidential and intended for the addressee(s) only. If you have received this 
message in error or there are any problems, please notify the sender 
immediately. The unauthorized use, disclosure, copying or alteration of this 
message is strictly forbidden. Note that any views or opinions presented in 
this email are solely those of the author and do not necessarily represent 
those of Radan Computational Ltd. The recipient(s) of this message should check 
it and any attached files for viruses: Radan Computational will accept no 
liability for any damage caused by any virus transmitted by this email.

Reply via email to