Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!sun-barr!decwrl!ucbvax!hoptoad!tim From: tim@hoptoad.uucp (Tim Maroney) Newsgroups: comp.sys.mac.programmer Subject: Re: MacsBug dcmd's in ThinkC Message-ID: <10324@hoptoad.uucp> Date: 19 Feb 90 22:02:42 GMT References: <6650@internal.Apple.COM> <2933@draken.nada.kth.se> <10246@hoptoad.uucp> <2952@draken.nada.kth.se> <10293@hoptoad.uucp> <1990Feb19.151837.22953@eng.umd.edu> Reply-To: tim@hoptoad.UUCP (Tim Maroney) Organization: Eclectic Software, San Francisco Lines: 35 In article <10293@hoptoad.uucp> tim@hoptoad.UUCP (Tim Maroney) writes: >>I guess I've never really seen the difficulty. I wrote several >>global-using code resources in MPW C 1.0; actually, I think the first >>one used the beta version. It's not now and never has been a big deal >>to do. Now that Apple has told you how to do it and given example >>code, it's as easy as it is in THINK C. In article <1990Feb19.151837.22953@eng.umd.edu> russotto@eng.umd.edu (Matthew T. Russotto) writes: >So, how do you write a code resource without having it include the ^&*^&* >A5Init segment? I was writing an INIT and found I had to write all the >Operating System (register-based) routines in assembly to avoid linking >with CRuntime and CInterface. Why do you want to avoid including %A5Init? I always linked it in by using a segment name command in the MPW Linker to merge it with the main code segment, e.g., if the main segment is called Internet, then give the directive "-sn "%A5Init"=Internet" to the linker. You probably don't need CInterface these days, with the new include files and calling conventions. (Though I don't see what's so horrific about linking with it....) You probably do need parts of CRunTime, since it contains arithmetic routines used to implement the operators. If there's anything in CRunTime that interferes with you, there are two solutions. First is to make a stripped copy of the library (using the -df flag to Lib) which omits any troublesome routines like main. The second is simply to write your own routines with the same names as the troublesome ones, link CRunTime last, and turn off linker warnings. I generally prefer the first solution. -- Tim Maroney, Mac Software Consultant, sun!hoptoad!tim, tim@toad.com "I am convinced that cross-posting is an evil Satanic plot." -- Eugene Miya on soc.net-people, misc.headlines, misc.kids, misc.misc, news.misc, and soc.misc