Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP Path: utzoo!mnetor!uunet!seismo!sundc!pitstop!sun!pepper!cmcmanis From: cmcmanis%pepper@Sun.COM (Chuck McManis) Newsgroups: comp.sys.amiga Subject: Re: Linking amiga.lib before lc.lib (Lattice) Message-ID: <31851@sun.uucp> Date: Fri, 23-Oct-87 15:18:52 EST Article-I.D.: sun.31851 Posted: Fri Oct 23 15:18:52 1987 Date-Received: Sun, 25-Oct-87 17:00:07 EST References: <561@inria.UUCP> Sender: news@sun.uucp Reply-To: cmcmanis@sun.UUCP (Chuck McManis) Organization: Sun Microsystems, Mountain View Lines: 29 Keywords: efficiency, docs In article <561@inria.UUCP> (Francois Rouaix) writes: > We all know by now that it's much better to link with amiga.lib >before the compiler.lib. >I'd like to know if the functions in amiga.lib (fprintf, fgetc, ...) >behave exactly like C functions (argument passing in stack, error codes ...). >I couldn't find any mention of this in RKM, and the only way I know >to get all pseudo-C functions in amiga.lib is to PrintA amiga.lib >and search for the name _function. In the AutoDocs (available from C/A for $20 as part of the Native Developers Upgrade Disk from CATS, 1200 Wilson Dr, West Chester, PA) there is some fairly complete documentation on the C type functions that are available in Amiga.Lib. Be forewarned however that they do not use a compatible stdio pointer (FILE *) that Lattice uses. So to use these functions with Lattice, the following steps must be taken : o Link with TWStartup.o rather than c.o. This opens stdin and stdout with C/A style file handles rather than Lattice file handles. o Link first with *just* Amiga.lib and make sure that you haven't used any of Lattice's routines that depend on stdin or stdout. o Then link with Amiga.lib first, and LC.lib second. When using these routines note that they expect 16 bit ints for such things as the %d format so if you print a Lattice int use %ld as the format specifier. Also C/A's printf does not support floating point formats that I know of. --Chuck McManis uucp: {anywhere}!sun!cmcmanis BIX: cmcmanis ARPAnet: cmcmanis@sun.com These opinions are my own and no one elses, but you knew that didn't you.