function result = isppc
%ISPPC True for Macintosh PowerPC.
%   ISPPC returns 1 if this computer is a Macintosh PowerPC
%   and 0 otherwise.
%
%   ISPPC uses GESTALT to determine if the PPC bit is turned
%   on or off

%   Copyright (c) 1984-98 by The MathWorks, Inc.
%   $Revision: 1.5 $ $Date: 1997/11/21 23:32:01 $

if ~strncmp(computer,'MA',2)
  result = logical(0);
  return
end

% make a call to the MEX-File that call the Gestalt MAC OS fcn
% we can't check if the gestalt MEX-File exists so we're doing a
% try-catch  
eval('bit_stream=gestalt(''sysa'');','error(''Gestalt MEX-File not found.'')');

% if this is a PPC, the 31st bit is on;
% if this is a 68k, the 32nd bit is on;
result=logical(bit_stream(31));
%
% COPYRIGHT (c) 2008
% 
% Applied Research Laboratories, The University of Texas at Austin
% (ARL:UT)
% All rights reserved.
% 
% This material may be reproduced by or for the U.S. Government
% only. This notice must appear in all copies of this file and its
% derivatives. Further distribution outside the U.S. Government is
% prohibited without the explicit written authorization from the
% Director of the Environmental Sciences Laboratory, ARL:UT.
% 
% THIS SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND,
% EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO THE
% IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
% PURPOSE, OR NONINFRINGEMENT.
% 
% IN NO EVENT WILL ARL:UT BE LIABLE FOR ANY DAMAGES WHATSOEVER ARISING
% OUT OF THE USE OR INABILITY TO USE THIS SOFTWARE, EVEN IF ARL:UT HAS
% BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
