Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!caen!sdd.hp.com!spool.mu.edu!uunet!mcsun!cernvax!chx400!chx400!bernina!neptune!c!mneerach From: mneerach@iiic.ethz.ch (Matthias Ulrich Neeracher) Newsgroups: comp.sys.mac.programmer Subject: Re: TrapAvailable Message-ID: <25916@neptune.inf.ethz.ch> Date: 23 Feb 91 11:41:02 GMT References: <29004@cs.yale.edu> Sender: news@neptune.inf.ethz.ch Reply-To: mneerach@iiic.ethz.ch Organization: Departement Informatik, ETH, Zurich Lines: 23 In article <29004@cs.yale.edu>, tarr-michael@CS.YALE.EDU (michael tarr) writes: > >When I try to use the call TrapAvailable as per the latest issue of >MacUser to find out if Gestalt is around, Think C 4.0.2 complains that >"TrapAvailable" is undefined. > >What am I missing? Simple: There is no such trap as TrapAvailable (yet). A simple method is to compare the address of the trap, obtained with NGetTrapAddress, with the trap address of the _Unimplemented trap ($A89F, I believe, but better look it up). If they are the same, the trap is not available. While this method works on all reasonably new macs, a more complicated incantation is needed if you are worried about compatibility with 64K ROM macs. Matthias -- Matthias Neeracher mneerach@iiic.ethz.ch "These days, though, you have to be pretty technical before you can even aspire to crudeness." -- William Gibson, _Johnny Mnemonic_