octave-maintainers
[Top][All Lists]
Advanced

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

MacOSX: ismac() implementation


From: John W. Eaton
Subject: MacOSX: ismac() implementation
Date: Thu, 06 Sep 2007 00:38:57 -0400

On  1-Sep-2007, Thomas Treichl wrote:

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

So that the implementation is similar to the current isunix and ispc
functions, I think ismac should just be

plus the copyright notice and doc string.

To make octave_config_info handle "mac", we need to change the
following lines in the DEFUN for octave_config_info in toplev.cc

        bool unix_system = true;
        bool windows_system = false;

  #if defined (WIN32)
        windows_system = true;
  #if !defined (__CYGWIN__)
        unix_system = false;
  #endif
  #endif

        m.assign ("unix", octave_value (unix_system));
        m.assign ("windows", octave_value (windows_system));

to be something like

        bool unix_system = true;
        bool mac_system = false;
        bool windows_system = false;

  #if defined (WIN32)
        windows_system = true;
  #if !defined (__CYGWIN__)
        unix_system = false;
  #endif
  #endif

  #if defined (???)
        mac_system = true;
  #endif

        m.assign ("unix", octave_value (unix_system));
        m.assign ("mac", octave_value (mac_system));
        m.assign ("windows", octave_value (windows_system));

but I'm not sure what macro we should test.  If there is nothing
predefined, then we will need some kind of change in configure.in as
well.

jwe


reply via email to

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