🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sys.amiga.tech
Article #4676

tip for compiling AmigaDos I/O on Un*x

#4676
From: Steve Koren
Date: Thu, 02 Aug 1990 13:43
27 lines
1278 bytes
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 <stdio.h>
#   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
Technical Details
Message-ID: <13920084@hpfelg.HP.COM>
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!sdd.hp.com!hplabs!hpcc01!hpbbn!hpbbrd!hpfcmdd!hpfcso!hpfelg!koren

Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!samsung!uakari.primate.wisc.edu!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