|
From: | Søren Hauberg |
Subject: | Re: MacOSX: ismac() implementation |
Date: | Sun, 02 Sep 2007 13:34:53 +0200 |
User-agent: | Thunderbird 1.5.0.13 (X11/20070824) |
Thomas Treichl skrev:
Sorry for answering my own email but I once again thought about ismac() and I think that this thread isn't worth being discussed because the solution is found on the Mac site where it says 'Based on Unix':Yeah, I thought about that as well. But I'm not sure if 'isunix' should be taken to literally. I mean, GNU/Linux isn't unix, but I don't think that 'isunix' should return false for GNU/Linux. I'm guessing the 'is[unix|pc|mac]' functions would most often be used like this:http://www.apple.com/macosx/features/unix/So I would say that isunix() should return true on Mac and also ismac() should return true.
if (ispc()) # windows code here elseif (isunix()) # BSD/Linux/Solaris/AIX/etc code here elseif (ismac()) # OS X code here else error("Unknown OS") endifBut since I only use GNU/Linux I'm only guessing here. I never really think about writing cross-platform code...
Søren
[Prev in Thread] | Current Thread | [Next in Thread] |