From 086c897981c05bee5a0d47737877823cfa590c03 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?K=C3=A1roly=20Balogh?= Date: Sat, 4 Apr 2020 13:24:29 +0000 Subject: [PATCH] amicommon: m68k-amiga legacy support git-svn-id: trunk@44566 - --- rtl/amicommon/athreads.pp | 8 ++++++++ rtl/amicommon/dos.pp | 8 ++++++++ rtl/amicommon/sysfile.inc | 6 ++++++ rtl/amicommon/sysos.inc | 7 +++++++ rtl/amicommon/sysutils.pp | 8 ++++++++ 5 files changed, 37 insertions(+) diff --git a/rtl/amicommon/athreads.pp b/rtl/amicommon/athreads.pp index 614bdc03b4..6bc66079d5 100644 --- a/rtl/amicommon/athreads.pp +++ b/rtl/amicommon/athreads.pp @@ -38,6 +38,14 @@ uses {$include timerd.inc} {$include doslibd.inc} {$include doslibf.inc} + +{$ifdef cpum68k} +{$if defined(amiga_v1_0_only) or defined(amiga_v1_2_only)} +{$include legacyexech.inc} +{$include legacydosh.inc} +{$endif} +{$endif} + {$ENDIF} const diff --git a/rtl/amicommon/dos.pp b/rtl/amicommon/dos.pp index 05bb49f61a..3f4b17d619 100644 --- a/rtl/amicommon/dos.pp +++ b/rtl/amicommon/dos.pp @@ -76,6 +76,14 @@ implementation {$include doslibf.inc} {$include utilf.inc} +{$ifdef cpum68k} +{$if defined(amiga_v1_0_only) or defined(amiga_v1_2_only)} +{$include legacyexech.inc} +{$include legacydosh.inc} +{$include legacyutilh.inc} +{$endif} +{$endif} + {$packrecords default} const diff --git a/rtl/amicommon/sysfile.inc b/rtl/amicommon/sysfile.inc index 21c10986c3..cbeb6170a8 100644 --- a/rtl/amicommon/sysfile.inc +++ b/rtl/amicommon/sysfile.inc @@ -287,7 +287,9 @@ begin end; end; +{$IFNDEF AMIGA_LEGACY} {$DEFINE ASYS_FILESIZE_USE_EXAMINEFH} +{$ENDIF} { I changed the double-Seek filesize method which we were using for 10+ years to the new ExamineFH() method. It should be available AmigaOS 2.0+, and much faster. @@ -335,12 +337,16 @@ end; procedure do_truncate(handle: THandle; pos: longint); begin checkCTRLC; +{$IFNDEF AMIGA_LEGACY} if CheckInList(ASYS_fileList,handle)<>nil then begin { Seeking from OFFSET_BEGINNING } if SetFileSize(handle,pos,OFFSET_BEGINNING)<0 then dosError2InOut(IoErr); end; +{$ELSE} + dosError2InOut(ERROR_NOT_IMPLEMENTED); +{$ENDIF} end; procedure do_open(var f;p:pchar;flags:longint; pchangeable: boolean); diff --git a/rtl/amicommon/sysos.inc b/rtl/amicommon/sysos.inc index cf89172674..b47f7b3552 100644 --- a/rtl/amicommon/sysos.inc +++ b/rtl/amicommon/sysos.inc @@ -31,6 +31,13 @@ {$include execf.inc} {$include doslibf.inc} +{$ifdef cpum68k} +{$if defined(amiga_v1_0_only) or defined(amiga_v1_2_only)} +{$include legacyexec.inc} +{$include legacydos.inc} +{$include legacyutil.inc} +{$endif} +{$endif} {***************************************************************************** CPU specific diff --git a/rtl/amicommon/sysutils.pp b/rtl/amicommon/sysutils.pp index 74f4a9083e..a53163b139 100644 --- a/rtl/amicommon/sysutils.pp +++ b/rtl/amicommon/sysutils.pp @@ -77,6 +77,14 @@ uses {$include doslibf.inc} {$include utilf.inc} +{$ifdef cpum68k} +{$if defined(amiga_v1_0_only) or defined(amiga_v1_2_only)} +{$include legacyexech.inc} +{$include legacydosh.inc} +{$include legacyutilh.inc} +{$endif} +{$endif} + { * Followings are implemented in the system unit! * } function PathConv(path: shortstring): shortstring; external name 'PATHCONV'; function PathConv(path: RawByteString): RawByteString; external name 'PATHCONVRBS';