[Win32utils-devel] Windows platform detection

Daniel Berger djberg96 at gmail.com
Tue Jan 18 08:01:10 EST 2011

On 1/18/11 4:44 AM, Luis Lavena wrote:
> On Tue, Jan 18, 2011 at 1:01 AM, Daniel Berger<djberg96 at gmail.com>  wrote:
>> Hi,
>> Is there any reason we can't use this to detect Windows?
>> File::PATH_SEPARATOR == ';'
>> Is there any other platform that uses ';' as a path separator?
> If you're doing cross-compilation, that can't be used as is not been set.
> mkmf extensions that contain code that depends on the platform will
> not be able to be cross compiled if you use that.
> RUBY_PLATFORM and File::ALT_SEPARATOR are the only ones been set.
> Normally ALT_SEPARATOR is nil on every platform except Windows.

Based on this:


I'm guessing that File::ALT_SEPARATOR could be non-nil on some of those 
platforms. OpenVMS, for instance. I've never built Ruby on OpenVMS, so I 
can't say for sure.

Besides cross-compiling is THE DEVIL.


More information about the win32utils-devel mailing list