Path: utzoo!utgpu!cunews!micor!latour!atronx!qpoint!dej From: dej@qpoint.amiga.ocunix.on.ca (David Jones) Message-ID: Newsgroups: comp.sys.amiga.tech Subject: Re: Help with useing SAS C5.10 to make Libraries Distribution: world References: <1991Jan9.104606.46575@cc.usu.edu> Date: Mon Jan 28 19:06:59 1991 >In article <1991Jan9.104606.46575@cc.usu.edu> slmt9@cc.usu.edu writes: > First of what does the declaration of the function itself have to look >like. I read in the source File that it has to be __saveds so my code looks >like this > >ULONG __saveds Add(a,b) >If there are any corrections that need to be made here please let me know. If you want your function to take parameters in registers (most Amiga library functions do), then you'll need to use __asm and register commands like this: ULONG __saveds __asm Add(register __d0 int a, register __d1 int b) Tips: The register name must be in lowercase. It must be prefixed by two underscores. You also need the type of each argument. When you compile, you need to use -ml on the command line. If your library calls routines which are in its function table (most libraries do), then don't use #pragmas for functions in your library. Instead, use prototypes formatted just like the function definitions. You may continue to use pragmas for functions in other libraries. With reference to a message that Peter Cherna sent to me about a month ago, do not perform any library initialization in the file "libinit.c" > Question number two. What does the .FD file need to look like. When I >compile I get asked what the name of the library is? When I try to type >something simple like MyLibrary then it tells me "error -- 'MyLibrary' is not a >defined symbol" so where deos it get the name and other info from. Does this >stuff go in the .FD file. Is there a different way to enter it? Go into your .fd file and check out the name of the base. If there is no underscore on the base name, add one. ##base FlowBase WRONG ##base _FlowBase BETTER -- David Jones UUCP: dej@qpoint.amiga.ocunix.on.ca Fido: 1:163/109.8