swalton@well.UUCP (Stephen R. Walton) (11/21/86)
In response to several (well, one :-)) requests, here are the changes I made to Matt Dillon's shell as he posted it in order to compile it under Aztec C. These apply to Version 2.01, which is the most recent one for which source has been posted to the USENET. First, it has to be compiled with the +L switch to force 32-bit ints, but you knew that. Second, I #defined the xstdio library out of existence by adding the following lines to the end of shell.h: #ifdef MCH_AMIGA #define check32() #define xopen(a,b,c) fopen(a,b) #define xgets(f,s,n) fgets(s,n,f) #define xclose(a) fclose(a) #define xseek(a,b,c) fseek(a,b,c) #define bmov(a,b,c) movmem(a,b,c) #endif Third, surround the call to free_memory() in main_exit() in file main.c with #ifndef MCH_AMIGA and #endif (that is, use it only with Lattice, since the Manx-provided malloc() automatically frees allocated memory upon an exit() call or return from the main program (hooray!)).Finally, you need xprintf.asm and ONLY xprintf.asm from the MY.LIB which was posted about the first of October. This is to get the version of fprintf() whose first argument is an AmigaDOS file handle rather than a stdio *FILE pointer. Change the "xref" and "xdef" directives at the beginning to "public" for the Manx assembler. Now compile the C modules, assemble xprintf.asm, and link with c32.lib. You're done! With version 3.20a, the executable is 23,248 bytes long. After all of that, there is one quirk: when printing a file with the shell's cat command, it comes out double-spaced. I haven't checked out why. Steve Walton