octave-maintainers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MacOSX: ismac() implementation


From: Thomas Treichl
Subject: MacOSX: ismac() implementation
Date: Sat, 01 Sep 2007 20:01:23 +0200
User-agent: Thunderbird 2.0.0.6 (Macintosh/20070728)

Hi,

in David's list

  http://www.nabble.com/Looking-for-help--tf4363692.html#a12440160

I've found that there should be a ismac() function. I've some questions how ismac() should be implemented: The easy way would be a function like the one that I've attached but I was also thinking about another implementation like the one for the MSVC version ie. feed through a #define from the CFLAGS in configure.in (eg. -DMACOSX) and then set or not set the values in src/toplev.cc DEFUN_DLD octave_config_info. The second solution would make more sense to me because then I could also send a patch for problems that may appear on the Mac platform and the different distributions must not patch the codes locally (eg. the A = [1:56]'/[1:56]' problem we've already discussed - I should also tell you that Apple is informed but I didn't get a fix yet and I think that older versions of Apple's vecLib won't be fixed at all, ie. people having a OSX 10.3 system will have this bug also in the future). And the last question is: If ismac() then !isunix()? If so then other files must be changed too and I need to know...

  Thomas
## Copyright (C) 2007 Thomas Treichl
##
## This file is part of Octave.
##
## Octave is free software; you can redistribute it and/or modify it
## under the terms of the GNU General Public License as published by
## the Free Software Foundation; either version 2, or (at your option)
## any later version.
##
## Octave is distributed in the hope that it will be useful, but
## WITHOUT ANY WARRANTY; without even the implied warranty of
## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
## General Public License for more details.
##
## You should have received a copy of the GNU General Public License
## along with Octave; see the file COPYING.  If not, write to the Free
## Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
## 02110-1301, USA.

## -*- texinfo -*-
## @deftypefn {Function File} {} ismac ()
## Return 1 if Octave is running on a Mac-like system and 0 otherwise.
## @end deftypefn

function retval = ismac ()

  vhost = octave_config_info ("canonical_host_type");
  if (regexp (vhost, '(.+)-apple-darwin(.+)'))
    retval = 1;
  else
    print_usage ();
  endif

endfunction

reply via email to

[Prev in Thread] Current Thread [Next in Thread]