Browse Source

--- Merging r18159 into '.':
U rtl/go32v2/sysutils.pp
U rtl/go32v2/dos.pp
--- Merging r18160 into '.':
G rtl/go32v2/dos.pp
--- Merging r18167 into '.':
U rtl/go32v2/Makefile.fpc
U rtl/go32v2/Makefile
--- Merging r18176 into '.':
G rtl/go32v2/sysutils.pp

# revisions: 18159,18160,18167,18176
------------------------------------------------------------------------
r18159 | pierre | 2011-08-10 16:27:24 +0200 (Wed, 10 Aug 2011) | 24 lines
Changed paths:
M /trunk/rtl/go32v2/dos.pp
M /trunk/rtl/go32v2/sysutils.pp

+ Implement !proxy support for long command line
this allows passing command lines longer than 126 chars to
Free Pascal or go32v2 programs.

By default only command lines longer than 126 chars are
passed using !proxy method,
it is however possible to disable this conversion completely by
set Use_go32v2_proxy boolean variable to false (true by fdefault).
In that case, command lines longer than 126 will be truncated, but
a warning is echoed to stderr.
For testing purposes, it is possible to set the boolean variable
force_go32v2_proxy to true to force systematic use of this
conversion.

This is set by default if the RTL is compiled with
SYSTEM_DEBUG_STARTUP conditional set.

To allow use by sysutils unit, a new procedure:
exec_ansistring(path : string;comline : ansistring);

has been added to the interface, which is now called instead
of Dos.Exec from Sysutils.ExecuteProcess


------------------------------------------------------------------------
------------------------------------------------------------------------
r18160 | pierre | 2011-08-10 17:34:08 +0200 (Wed, 10 Aug 2011) | 4 lines
Changed paths:
M /trunk/rtl/go32v2/dos.pp

* Fix error in last commit for quoted args.
end_of_args needs to be reset for even if
curent_arg is empty.

------------------------------------------------------------------------
------------------------------------------------------------------------
r18167 | pierre | 2011-08-11 14:05:16 +0200 (Thu, 11 Aug 2011) | 1 line
Changed paths:
M /trunk/rtl/go32v2/Makefile
M /trunk/rtl/go32v2/Makefile.fpc

Add stdconvs unit for go32v2 target
------------------------------------------------------------------------
------------------------------------------------------------------------
r18176 | pierre | 2011-08-12 10:35:55 +0200 (Fri, 12 Aug 2011) | 5 lines
Changed paths:
M /trunk/rtl/go32v2/sysutils.pp

* Avoid warnings about pointer to signed integers typecasts
+ Accept on trailing directory seperator for DirectoryExists
and handle 'X:' directory separately by calling
GetDir(drive,dir) to find the current directory of the drive
considered.
------------------------------------------------------------------------

git-svn-id: branches/fixes_2_6@18889 -

marco 14 years ago
parent
commit
2bcf3030ad
4 changed files with 292 additions and 88 deletions
  1. 67 64
      rtl/go32v2/Makefile
  2. 6 3
      rtl/go32v2/Makefile.fpc
  3. 183 17
      rtl/go32v2/dos.pp
  4. 36 4
      rtl/go32v2/sysutils.pp

+ 67 - 64
rtl/go32v2/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2011/08/03]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2011/08/09]
 #
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-haiku i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian i386-nativent i386-iphonesim m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded powerpc-wii sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-solaris x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-darwin arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded avr-embedded armeb-linux armeb-embedded mipsel-linux
@@ -308,193 +308,193 @@ ifdef NO_EXCEPTIONS_IN_SYSTEM
 override FPCOPT+=-dNO_EXCEPTIONS_IN_SYSTEM
 endif
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-haiku)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-nativent)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-iphonesim)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),powerpc-wii)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),x86_64-solaris)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),x86_64-darwin)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),arm-darwin)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),avr-embedded)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),armeb-linux)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),armeb-embedded)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),mipsel-linux)
-override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils
+override TARGET_UNITS+=system objpas macpas iso7185 strings go32 dpmiexcp initc ports profile dxetype dxeload emu387 dos crt objects printer cmem sysutils classes math typinfo matrix cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl msmouse charset varutils video mouse keyboard variants vesamode types fmtbcd sysconst rtlconst dateutil convutil strutils stdconvs
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_IMPLICITUNITS+=exeinfo
@@ -2819,6 +2819,9 @@ convutil$(PPUEXT) : $(OBJPASDIR)/convutil.pp
 	$(COMPILER) -Fi$(OBJPASDIR) $(OBJPASDIR)/convutil.pp
 strutils$(PPUEXT) : $(OBJPASDIR)/strutils.pp
 	$(COMPILER) $(OBJPASDIR)/strutils.pp
+stdconvs$(PPUEXT) : $(OBJPASDIR)/stdconvs.pp objpas$(PPUEXT) system$(PPUEXT) \
+		    sysutils$(PPUEXT)
+	$(COMPILER) $(OBJPASDIR)/stdconvs.pp
 macpas$(PPUEXT) : $(INC)/macpas.pp objpas$(PPUEXT) math$(PPUEXT)
 	$(COMPILER) $(INC)/macpas.pp $(REDIR)
 cpu$(PPUEXT) : $(PROCINC)/cpu.pp system$(PPUEXT)

+ 6 - 3
rtl/go32v2/Makefile.fpc

@@ -12,7 +12,7 @@ units=system objpas macpas iso7185 strings \
       cpu mmx ucomplex getopts heaptrc lineinfo lnfodwrf ctypes fgl \
       msmouse charset varutils \
       video mouse keyboard variants vesamode types fmtbcd \
-      sysconst rtlconst dateutil convutil strutils
+      sysconst rtlconst dateutil convutil strutils stdconvs
 rsts=math varutils typinfo classes variants dateutil sysconst
 implicitunits=exeinfo
 [require]
@@ -118,10 +118,10 @@ varutils$(PPUEXT) : $(OBJPASDIR)/cvarutil.inc $(OBJPASDIR)/varutils.inc \
         $(COMPILER) -I$(OBJPASDIR) varutils.pp
 variants$(PPUEXT) : $(INC)/variants.pp varutils$(PPUEXT) sysutils$(PPUEXT) sysconst$(PPUEXT) typinfo$(PPUEXT) rtlconst$(PPUEXT)
         $(COMPILER) -Fi$(INC) $(INC)/variants.pp
-        
+
 fmtbcd$(PPUEXT) : $(OBJPASDIR)/fmtbcd.pp objpas$(PPUEXT) sysutils$(PPUEXT) variants$(PPUEXT) classes$(PPUEXT) system$(PPUEXT)
         $(COMPILER) $(OBJPASDIR)/fmtbcd.pp
-        
+
 types$(PPUEXT) : $(OBJPASDIR)/types.pp objpas$(PPUEXT)
         $(COMPILER) $(OBJPASDIR)/types.pp
 rtlconst$(PPUEXT) : $(OBJPASDIR)/rtlconst.pp
@@ -134,6 +134,9 @@ convutil$(PPUEXT) : $(OBJPASDIR)/convutil.pp
         $(COMPILER) -Fi$(OBJPASDIR) $(OBJPASDIR)/convutil.pp
 strutils$(PPUEXT) : $(OBJPASDIR)/strutils.pp
         $(COMPILER) $(OBJPASDIR)/strutils.pp
+stdconvs$(PPUEXT) : $(OBJPASDIR)/stdconvs.pp objpas$(PPUEXT) system$(PPUEXT) \
+                    sysutils$(PPUEXT)
+        $(COMPILER) $(OBJPASDIR)/stdconvs.pp
 #
 # Mac Pascal Model
 #

+ 183 - 17
rtl/go32v2/dos.pp

@@ -37,6 +37,38 @@ Type
 
 {$i dosh.inc}
 
+{$IfDef SYSTEM_DEBUG_STARTUP}
+  {$DEFINE FORCE_PROXY}
+{$endif SYSTEM_DEBUG_STARTUP}
+Const
+  { This variable can be set to true
+    to force use of !proxy command lines even for short
+    strings, for debugging purposes mainly, as
+    this might have negative impact if trying to
+    call non-go32v2 programs }
+  force_go32v2_proxy : boolean =
+{$ifdef FORCE_PROXY}
+  true;
+{$DEFINE DEBUG_PROXY}
+{$else not FORCE_PROXY}
+  false;
+{$endif not FORCE_PROXY}
+  { This variable allows to use !proxy if command line is
+    longer than 126 characters.
+    This will only work if the called program knows how to handle
+    those command lines.
+    Luckily this is the case for Free Pascal compiled
+    programs (even old versions)
+    and go32v2 DJGPP programs.
+    You can set this to false to get a warning to stderr
+    if command line is too long. }
+  Use_go32v2_proxy : boolean = true;
+
+{ Added to interface so that there is no need to implement it
+  both in dos and sysutils units }
+
+procedure exec_ansistring(path : string;comline : ansistring);
+
 implementation
 
 uses
@@ -165,7 +197,7 @@ end;
 const
   DOS_MAX_COMMAND_LINE_LENGTH = 126;
 
-procedure exec(const path : pathstr;const comline : comstr);
+procedure exec_ansistring(path : string;comline : ansistring);
 type
   realptr = packed record
     ofs,seg : word;
@@ -184,23 +216,30 @@ var
   i,la_env,
   la_p,la_c,la_e,
   fcb1_la,fcb2_la : longint;
+  use_proxy       : boolean;
+  proxy_argc      : longint;
   execblock       : texecblock;
-  c,p             : string;
+  c               : ansistring;
+  p               : string;
 
-  function paste_to_dos(src : string;cr : boolean; n : longint) : boolean;
+  function paste_to_dos(src : string;add_cr_at_end, include_string_length : boolean) : boolean;
   {Changed by Laaca - added parameter N}
   var
     c : pchar;
     CLen : cardinal;
-    ls : longint;
+    start_pos,ls : longint;
   begin
      paste_to_dos:=false;
-     ls:=Length(src)-n;
+     if include_string_length then
+       start_pos:=0
+     else
+       start_pos:=1;
+     ls:=Length(src)-start_pos;
      if current_dos_buffer_pos+ls+3>transfer_buffer+tb_size then
       RunError(217);
      getmem(c,ls+3);
-     move(src[n],c^,ls+1);
-     if cr then
+     move(src[start_pos],c^,ls+1);
+     if add_cr_at_end then
       begin
         c[ls+1]:=#13;
         c[ls+2]:=#0;
@@ -214,17 +253,125 @@ var
      paste_to_dos:=true;
   end;
 
+  procedure setup_proxy_cmdline;
+  const
+    MAX_ARGS = 128;
+  var
+    i : longint;
+    quote : char;
+    end_of_arg, skip_char : boolean;
+    la_proxy_seg    : word;
+    la_proxy_ofs    : longint;
+    current_arg : string;
+    la_argv_ofs : array [0..MAX_ARGS] of word;
+  begin
+    quote:=#0;
+    current_arg:='';
+    proxy_argc:=0;
+    end_of_arg:=false;
+    while current_dos_buffer_pos mod 16 <> 0 do
+      inc(current_dos_buffer_pos);
+    la_proxy_seg:=current_dos_buffer_pos shr 4;
+    { Also copy parameter 0 }
+    la_argv_ofs[0]:=current_dos_buffer_pos-la_proxy_seg*16;
+    { Note that this should be done before
+      alteriing p value }
+    paste_to_dos(p,false,false);
+    inc(proxy_argc);
+    for i:=1 to length(c) do
+      begin
+        skip_char:=false;
+        case c[i] of
+          #1..#32:
+            begin
+              if quote=#0 then
+                end_of_arg:=true;
+            end;
+          '"' :
+            begin
+              if quote=#0 then
+                begin
+                  quote:='"';
+                  skip_char:=true;
+                end
+              else if quote='"' then
+                end_of_arg:=true;
+            end;
+          '''' :
+            begin
+              if quote=#0 then
+                begin
+                  quote:='''';
+                  skip_char:=true;
+                end
+              else if quote='''' then
+                end_of_arg:=true;
+            end;
+        end;
+        if not end_of_arg and not skip_char then
+          current_arg:=current_arg+c[i];
+        if i=length(c) then
+          end_of_arg:=true;
+        if end_of_arg then
+          begin
+            { Allow empty args using "" or '' }
+            if (current_arg<>'') or (quote<>#0) then
+              begin
+                if proxy_argc>MAX_ARGS then
+                  begin
+                    writeln(stderr,'Too many arguments in Dos.exec');
+                    RunError(217);
+                  end;
+                la_argv_ofs[proxy_argc]:=current_dos_buffer_pos-la_proxy_seg*16;
+    {$ifdef DEBUG_PROXY}
+                writeln(stderr,'arg ',proxy_argc,'="',current_arg,'"');
+    {$endif DEBUG_PROXY}
+                paste_to_dos(current_arg,false,false);
+                inc(proxy_argc);
+                quote:=#0;
+                current_arg:='';
+              end;
+            { Always reset end_of_arg boolean }
+            end_of_arg:=false;
+          end;
+      end;
+    la_proxy_ofs:=current_dos_buffer_pos - la_proxy_seg*16;
+    seg_move(get_ds,longint(@la_argv_ofs),dosmemselector,
+             current_dos_buffer_pos,proxy_argc*sizeof(word));
+    current_dos_buffer_pos:=current_dos_buffer_pos + proxy_argc*sizeof(word);
+    c:='!proxy '+hexstr(proxy_argc,4)+' '+hexstr(la_proxy_seg,4)
+       +' '+hexstr(la_proxy_ofs,4);
+{$ifdef DEBUG_PROXY}
+    writeln(stderr,'Using comline "',c,'"');
+{$endif DEBUG_PROXY}
+  end;
+
+
 begin
 { create command line }
   c:=comline;
-  if length(c)>DOS_MAX_COMMAND_LINE_LENGTH then
-    c[0]:=chr(DOS_MAX_COMMAND_LINE_LENGTH);
+  if force_go32v2_proxy then
+    Use_proxy:=true
+  else if length(c)>DOS_MAX_COMMAND_LINE_LENGTH then
+    begin
+      if Use_go32v2_proxy then
+        begin
+          Use_Proxy:=true;
+        end
+      else
+        begin
+           writeln(stderr,'Dos.exec command line truncated to ',
+                   DOS_MAX_COMMAND_LINE_LENGTH,' chars');
+           writeln(stderr,'Before: "',c,'"');
+           setlength(c, DOS_MAX_COMMAND_LINE_LENGTH);
+           writeln(stderr,'After: "',c,'"');
+         end;
+    end;
 { create path }
+{$ifdef DEBUG_PROXY}
+  writeln(stderr,'Dos.exec path="',path,'"');
+{$endif DEBUG_PROXY}
   p:=path;
-{ allow slash as backslash }
-  DoDirSeparators(p);
-  if LFNSupport then
-    GetShortName(p);
 { create buffer }
   la_env:=transfer_buffer;
   while (la_env and 15)<>0 do
@@ -232,13 +379,24 @@ begin
   current_dos_buffer_pos:=la_env;
 { copy environment }
   for i:=1 to envcount do
-   paste_to_dos(envstr(i),false,1);
+   paste_to_dos(envstr(i),false,false);
   {the behaviour is still suboptimal because variable COMMAND is stripped out}
-  paste_to_dos(chr(0),false,1); { adds a double zero at the end }
+  paste_to_dos(chr(0),false,false); { adds a double zero at the end }
+  if use_proxy then
+    setup_proxy_cmdline;
+{ allow slash as backslash }
+  DoDirSeparators(p);
+  if LFNSupport then
+    GetShortName(p);
+  { Add program to DosBuffer with
+    length at start }
   la_p:=current_dos_buffer_pos;
-  paste_to_dos(p,false,0);
+  paste_to_dos(p,false,true);
+  { Add command line args to DosBuffer with
+    length at start and Carriage Return at end }
   la_c:=current_dos_buffer_pos;
-  paste_to_dos(c,true,0);
+  paste_to_dos(c,true,true);
+
   la_e:=current_dos_buffer_pos;
   fcb1_la:=la_e;
   la_e:=la_e+16;
@@ -261,6 +419,9 @@ begin
   dosregs.esi:=(la_c+arg_ofs) and 15;
   dosregs.es:=fcb2_la shr 4;
   dosregs.edi:=fcb2_la and 15;
+{$ifdef DEBUG_PROXY}
+  flush(stderr);
+{$endif DEBUG_PROXY}
   msdos(dosregs);
   with execblock do
    begin
@@ -290,6 +451,11 @@ begin
    LastDosExitCode:=0;
 end;
 
+procedure exec(const path : pathstr;const comline : comstr);
+begin
+  exec_ansistring(path, comline);
+end;
+
 
 procedure getcbreak(var breakvalue : boolean);
 begin

+ 36 - 4
rtl/go32v2/sysutils.pp

@@ -166,7 +166,7 @@ begin
         Result:=-1;
         exit;
       end;
-     syscopyfromdos(Longint(@Buffer)+readsize,lo(regs.realeax));
+     syscopyfromdos(Longint(dword(@Buffer)+readsize),lo(regs.realeax));
      inc(readsize,lo(regs.realeax));
      dec(Count,lo(regs.realeax));
      { stop when not the specified size is read }
@@ -190,7 +190,7 @@ begin
       size:=tb_size
      else
       size:=Count;
-     syscopytodos(Longint(@Buffer)+writesize,size);
+     syscopytodos(Longint(dword(@Buffer)+writesize),size);
      regs.realecx:=size;
      regs.realedx:=tb_offset;
      regs.realds:=tb_segment;
@@ -303,8 +303,40 @@ end;
 Function DirectoryExists (Const Directory : String) : Boolean;
 Var
   Sr : Searchrec;
+  Dir : String;
+  drive : byte;
+  StoredIORes : longint;
 begin
-  DOS.FindFirst(Directory,$3f,sr);
+  Dir:=Directory;
+  if (length(dir)=2) and (dir[2]=':') and
+     ((dir[1] in ['A'..'Z']) or (dir[1] in ['a'..'z'])) then
+    begin
+      { We want to test GetCurDir }
+      if dir[1] in ['A'..'Z'] then
+        drive:=ord(dir[1])-ord('A')+1
+      else
+        drive:=ord(dir[1])-ord('a')+1;
+{$undef OPT_I}
+{$ifopt I+}
+  {$define OPT_I}
+{$endif}
+{$I-}
+      StoredIORes:=InOutRes;
+      InOutRes:=0;
+      GetDir(drive,dir);
+      if InOutRes <> 0 then
+        begin
+          InOutRes:=StoredIORes;
+          result:=false;
+          exit;
+        end;
+    end;
+{$ifdef OPT_I}
+  {$I+}
+{$endif}
+  if (length(dir)>1) and (dir[length(dir)] in ['/','\']) then
+    dir:=copy(dir,1,length(dir)-1);
+  DOS.FindFirst(Dir,$3f,sr);
   if DosError = 0 then
    begin
      Result:=(sr.attr and $10)=$10;
@@ -782,7 +814,7 @@ var
   CommandLine: AnsiString;
 
 begin
-  dos.exec(path,comline);
+  dos.exec_ansistring(path,comline);
 
   if (Dos.DosError <> 0) then
     begin