Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!ames!decwrl!sdd.hp.com!hplabs!hpcc01!hpbbn!hpbbrd!hpfcmdd!hpfcso!hpfelg!koren From: koren@hpfelg.HP.COM (Steve Koren) Newsgroups: comp.sys.amiga.tech Subject: tip for compiling AmigaDos I/O on Un*x Message-ID: <13920084@hpfelg.HP.COM> Date: 2 Aug 90 13:43:04 GMT Organization: HP Elec. Design Div. -FtCollins Lines: 27 This might be of interest to folks trying to compile programs written with AmigaDos I/O (Read(), etc) on a Un*x or DOS machine. Try making a bunch of #defines, such as: #ifndef AMIGA # include # define BPTR FILE * # define Close(x) fclose(x) # define Open(x,y) fopen(x,y) # define Read(x,y,z) read(fileno(x),y,z) # define Write(x,y,z) write(fileno(x),y,z) # define MODE_OLDFILE "r" # define MODE_NEWFILE "w" # define Input() stdin # define Output() stdout # define Printf printf #endif I've had pretty good luck getting stuff to compile under Un*x that way. You can do the reverse as well, as long as you remember which Un*x stdio calls not to use. Have to remember that MODE_NEWFILE is not really the same as "w", etc, as well. Works for ARP stuff too, such as the Printf->printf above. - steve