Selaa lähdekoodia

* rtl part of Olivier Coursier's BeOS patch

git-svn-id: trunk@8396 -
florian 18 vuotta sitten
vanhempi
commit
bcd5fc555a

+ 0 - 5
.gitattributes

@@ -4417,7 +4417,6 @@ rtl/beos/i386/dllprt.cpp -text
 rtl/beos/i386/func.as svneol=native#text/plain
 rtl/beos/i386/prt0.as svneol=native#text/plain
 rtl/beos/osmacro.inc svneol=native#text/plain
-rtl/beos/osposixh.inc svneol=native#text/plain
 rtl/beos/ossysc.inc svneol=native#text/plain
 rtl/beos/ostypes.inc svneol=native#text/plain
 rtl/beos/ptypes.inc svneol=native#text/plain
@@ -4427,8 +4426,6 @@ rtl/beos/suuid.inc svneol=native#text/plain
 rtl/beos/syscall.inc svneol=native#text/plain
 rtl/beos/syscallh.inc svneol=native#text/plain
 rtl/beos/sysconst.inc svneol=native#text/plain
-rtl/beos/sysdir.inc svneol=native#text/plain
-rtl/beos/sysfile.inc svneol=native#text/plain
 rtl/beos/sysheap.inc svneol=native#text/plain
 rtl/beos/sysnr.inc svneol=native#text/plain
 rtl/beos/sysos.inc svneol=native#text/plain
@@ -4442,8 +4439,6 @@ rtl/beos/unixsock.inc svneol=native#text/plain
 rtl/beos/unxconst.inc svneol=native#text/plain
 rtl/beos/unxfunc.inc svneol=native#text/plain
 rtl/beos/unxsockh.inc svneol=native#text/plain
-rtl/beos/unxsysc.inc svneol=native#text/plain
-rtl/beos/unxsysch.inc svneol=native#text/plain
 rtl/bsd/bsd.pas -text
 rtl/bsd/bunxfunch.inc svneol=native#text/plain
 rtl/bsd/bunxsysc.inc svneol=native#text/plain

+ 70 - 56
rtl/beos/Makefile

@@ -246,160 +246,160 @@ override FPCOPT+= -dHASUNIX -n -dFPC_USE_LIBC -Si
 OBJPASDIR=$(RTL)/objpas
 GRAPHDIR=$(INC)/graph
 ifeq ($(FULL_TARGET),i386-linux)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),i386-go32v2)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),i386-win32)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),i386-os2)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),i386-freebsd)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),i386-beos)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),i386-netbsd)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),i386-solaris)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),i386-qnx)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),i386-netware)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),i386-openbsd)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),i386-wdosx)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),i386-darwin)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),i386-emx)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),i386-watcom)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),i386-netwlibc)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),i386-wince)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),i386-embedded)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),i386-symbian)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),m68k-linux)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),m68k-freebsd)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),m68k-netbsd)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),m68k-amiga)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),m68k-atari)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),m68k-openbsd)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),m68k-palmos)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),m68k-embedded)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),powerpc-linux)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),powerpc-netbsd)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),powerpc-amiga)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),powerpc-macos)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),powerpc-darwin)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),powerpc-morphos)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),powerpc-embedded)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),sparc-linux)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),sparc-netbsd)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),sparc-solaris)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),sparc-embedded)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),x86_64-linux)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),x86_64-win64)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),x86_64-embedded)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),arm-linux)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),arm-palmos)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),arm-wince)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),arm-gba)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),arm-nds)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),arm-embedded)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),arm-symbian)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),powerpc64-darwin)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
-override TARGET_UNITS+=system baseunix unixtype objpas strings errors dos objects sysconst sysutils types typinfo classes math varutils cpu mmx getopts heaptrc lineinfo variants rtlconsts syscall unix unixutil strutils termio initc crt video keyboard dateutils fmtbcd sockets dynlibs
+override TARGET_UNITS+=system baseunix unixtype ctypes objpas macpas strings errors dos dl objects sysconst sysutils types charset ucomplex typinfo classes math varutils cpu mmx getopts heaptrc lineinfo lnfodwrf variants rtlconsts syscall unix unixutil strutils termio initc cmem crt video mouse keyboard dateutils fmtbcd sockets dynlibs cwstring
 endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_LOADERS+=prt0 cprt0 func dllprt
@@ -2477,7 +2477,7 @@ system$(PPUEXT) : system.pp $(SYSDEPS) $(UNIXINC)/sysunixh.inc
 	$(COMPILER) -Us -Sg $(SYSTEMUNIT).pp
 objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
 	$(COMPILER) -Fi$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
-dateutils$(PPUEXT): $(OBJPASDIR)/dateutils.pp baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+dateutils$(PPUEXT): $(OBJPASDIR)/dateutils.pp baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) types$(PPUEXT)
 	$(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/dateutils.pp
 strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc \
 		   $(PROCINC)/strings.inc $(PROCINC)/stringss.inc \
@@ -2486,7 +2486,7 @@ baseunix$(PPUEXT) : $(UNIXINC)/unixtype.pp $(SYSTEMUNIT)$(PPUEXT)
 	$(COMPILER) -Fi$(UNIXINC) -Fu$(UNIXINC) baseunix.pp
 unix$(PPUEXT) : $(UNIXINC)/unix.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
 		 sysconst.inc $(UNIXINC)/timezone.inc \
-		 unxsysc.inc baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+		 baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 linux$(PPUEXT) : baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 dos$(PPUEXT) : $(UNIXINC)/dos.pp $(INC)/filerec.inc $(INC)/textrec.inc strings$(PPUEXT) \
 	       unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
@@ -2495,14 +2495,14 @@ crt$(PPUEXT) : crt.pp $(INC)/textrec.inc termio.pp system$(PPUEXT)
 	$(COMPILER) $(UNIXINC)/crt.pp $(REDIR)
 video$(PPUEXT) : video.pp $(INC)/textrec.inc termio.pp system$(PPUEXT)
 	$(COMPILER) -Fu$(UNIXINC) $(UNIXINC)/video.pp $(REDIR)
-keyboard$(PPUEXT) : $(UNIXINC)/keyboard.pp $(INC)/textrec.inc termio.pp system$(PPUEXT)
+keyboard$(PPUEXT) : $(UNIXINC)/keyboard.pp mouse$(PPUEXT) $(INC)/textrec.inc termio.pp system$(PPUEXT)
 	$(COMPILER) $(UNIXINC)/keyboard.pp $(REDIR) -dNOGPM
 objects$(PPUEXT) : $(INC)/objects.pp system$(PPUEXT)
 sysutils$(PPUEXT) : sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
 		    objpas$(PPUEXT) $(OBJPASDIR)/sysconst$(PPUEXT) # beos$(PPUEXT)
 	$(COMPILER) -Fi$(OBJPASDIR)/sysutils -Fi$(UNIXINC) $(UNIXINC)/sysutils.pp
 classes$(PPUEXT) : classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
-		   sysutils$(PPUEXT) $(OBJPASDIR)/typinfo$(PPUEXT) $(OBJPASDIR)/rtlconsts$(PPUEXT) 
+		   sysutils$(PPUEXT) $(OBJPASDIR)/typinfo$(PPUEXT) types$(PPUEXT) $(OBJPASDIR)/rtlconsts$(PPUEXT) 
 	$(COMPILER) -Fi$(OBJPASDIR) -Fi$(OBJPASDIR)/classes classes.pp
 typinfo$(PPUEXT): $(OBJPASDIR)/typinfo.pp objpas$(PPUEXT)
 	$(COMPILER) -Sg $(OBJPASDIR)/typinfo.pp
@@ -2524,12 +2524,26 @@ rtlconsts$(PPUEXT) : $(OBJPASDIR)/rtlconsts.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PP
 strutils$(PPUEXT) : $(OBJPASDIR)/strutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
 		    sysutils$(PPUEXT)
 	$(COMPILER) $(OBJPASDIR)/strutils.pp
+macpas$(PPUEXT) : $(INC)/macpas.pp system$(PPUEXT)
+	$(COMPILER) $(INC)/macpas.pp $(REDIR)
 cpu$(PPUEXT) : $(PROCINC)/cpu.pp system$(PPUEXT)
 mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) system$(PPUEXT)
 getopts$(PPUEXT) : $(INC)/getopts.pp system$(PPUEXT)
 heaptrc$(PPUEXT) : $(INC)/heaptrc.pp system$(PPUEXT)
 	$(COMPILER) $(INC)/heaptrc.pp
 lineinfo$(PPUEXT) : $(INC)/lineinfo.pp system$(PPUEXT)
+lnfodwrf$(PPUEXT) : $(INC)/lnfodwrf.pp $(SYSTEMUNIT)$(PPUEXT) strings$(PPUEXT)
+charset$(PPUEXT) : $(INC)/charset.pp objpas$(PPUEXT)
+ucomplex$(PPUEXT) : $(INC)/ucomplex.pp math$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) math$(PPUEXT)
+termio$(PPUEXT) : baseunix$(PPUEXT)
+mouse$(PPUEXT) : baseunix$(PPUEXT) video$(PPUEXT)
+	$(COMPILER) $(UNIXINC)/mouse.pp $(REDIR) -dNOGPM
+dl$(PPUEXT) : $(SYSTEMUNIT)$(PPUEXT) unixtype$(PPUEXT)
 sockets$(PPUEXT) : $(UNIXINC)/sockets.pp $(INC)/textrec.inc $(INC)/filerec.inc \
 		   unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 dynlibs$(PPUEXT) : $(INC)/dynlibs.pas $(UNIXINC)/dynlibs.inc dl$(PPUEXT) objpas$(PPUEXT)
+cmem$(PPUEXT) : $(INC)/cmem.pp $(SYSTEMUNIT)$(PPUEXT)
+ctypes$(PPUEXT) :  $(INC)/ctypes.pp $(SYSTEMUNIT)$(PPUEXT)
+variants$(PPUEXT) : $(INC)/variants.pp sysutils$(PPUEXT) sysconst$(PPUEXT) varutils$(PPUEXT) typinfo$(PPUEXT) rtlconsts$(PPUEXT) math$(PPUEXT)
+	$(COMPILER) -Fi$(INC) $(INC)/variants.pp
+cwstring$(PPUEXT) : $(UNIXINC)/cwstring.pp $(SYSTEMUNIT)$(PPUEXT) sysutils$(PPUEXT) baseunix$(PPUEXT) unix$(PPUEXT) unixtype$(PPUEXT) ctypes$(PPUEXT)

+ 43 - 11
rtl/beos/Makefile.fpc

@@ -7,14 +7,15 @@ main=rtl
 
 [target]
 loaders=prt0 cprt0 func dllprt
-units=system baseunix unixtype objpas strings \
+units=system baseunix unixtype ctypes objpas macpas strings \
 #      beos \
-      errors dos objects \
+      errors dos dl objects \
       sysconst sysutils \
-      types typinfo classes math varutils \
-      cpu mmx getopts heaptrc lineinfo variants \
-      rtlconsts syscall unix unixutil strutils termio initc crt video keyboard \
-      dateutils fmtbcd sockets dynlibs
+      types charset ucomplex typinfo classes math varutils \
+      cpu mmx getopts heaptrc lineinfo lnfodwrf variants \
+      rtlconsts syscall unix unixutil strutils termio initc \
+      cmem crt video mouse keyboard \
+      dateutils fmtbcd sockets dynlibs cwstring
 rsts=math varutils typinfo variants sysconst rtlconsts dateutils
 
 [require]
@@ -30,7 +31,7 @@ cpu=i386
 
 [compiler]
 includedir=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) $(OSPROCINC)
-sourcedir=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET)
+sourcedir=$(INC) $(PROCINC) $(UNIXINC) $(CPU_TARGET) 
 targetdir=.
 
 [lib]
@@ -108,7 +109,7 @@ system$(PPUEXT) : system.pp $(SYSDEPS) $(UNIXINC)/sysunixh.inc
 objpas$(PPUEXT): $(OBJPASDIR)/objpas.pp $(INC)/except.inc $(SYSTEMUNIT)$(PPUEXT)
         $(COMPILER) -Fi$(OBJPASDIR) $(OBJPASDIR)/objpas.pp
 
-dateutils$(PPUEXT): $(OBJPASDIR)/dateutils.pp baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+dateutils$(PPUEXT): $(OBJPASDIR)/dateutils.pp baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) types$(PPUEXT)
 	$(COMPILER) -I$(OBJPASDIR) $(OBJPASDIR)/dateutils.pp
 
 strings$(PPUEXT) : $(INC)/strings.pp $(INC)/stringsi.inc \
@@ -126,7 +127,7 @@ baseunix$(PPUEXT) : $(UNIXINC)/unixtype.pp $(SYSTEMUNIT)$(PPUEXT)
 
 unix$(PPUEXT) : $(UNIXINC)/unix.pp strings$(PPUEXT) $(INC)/textrec.inc $(INC)/filerec.inc \
                  sysconst.inc $(UNIXINC)/timezone.inc \
-                 unxsysc.inc baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
+                 baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 
 linux$(PPUEXT) : baseunix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 
@@ -147,7 +148,7 @@ crt$(PPUEXT) : crt.pp $(INC)/textrec.inc termio.pp system$(PPUEXT)
 video$(PPUEXT) : video.pp $(INC)/textrec.inc termio.pp system$(PPUEXT)
         $(COMPILER) -Fu$(UNIXINC) $(UNIXINC)/video.pp $(REDIR)
         
-keyboard$(PPUEXT) : $(UNIXINC)/keyboard.pp $(INC)/textrec.inc termio.pp system$(PPUEXT)
+keyboard$(PPUEXT) : $(UNIXINC)/keyboard.pp mouse$(PPUEXT) $(INC)/textrec.inc termio.pp system$(PPUEXT)
         $(COMPILER) $(UNIXINC)/keyboard.pp $(REDIR) -dNOGPM
 
                        
@@ -162,7 +163,7 @@ sysutils$(PPUEXT) : sysutils.pp $(wildcard $(OBJPASDIR)/sysutils/*.inc) \
         $(COMPILER) -Fi$(OBJPASDIR)/sysutils -Fi$(UNIXINC) $(UNIXINC)/sysutils.pp
 
 classes$(PPUEXT) : classes.pp $(wildcard $(OBJPASDIR)/classes/*.inc) \
-                   sysutils$(PPUEXT) $(OBJPASDIR)/typinfo$(PPUEXT) $(OBJPASDIR)/rtlconsts$(PPUEXT) 
+                   sysutils$(PPUEXT) $(OBJPASDIR)/typinfo$(PPUEXT) types$(PPUEXT) $(OBJPASDIR)/rtlconsts$(PPUEXT) 
 #                   $(UNIXINC)/systhrd$(PPUEXT)
         $(COMPILER) -Fi$(OBJPASDIR) -Fi$(OBJPASDIR)/classes classes.pp
 
@@ -194,6 +195,13 @@ rtlconsts$(PPUEXT) : $(OBJPASDIR)/rtlconsts.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PP
 strutils$(PPUEXT) : $(OBJPASDIR)/strutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
                     sysutils$(PPUEXT)
         $(COMPILER) $(OBJPASDIR)/strutils.pp
+
+#
+# Mac Pascal Model
+#
+
+macpas$(PPUEXT) : $(INC)/macpas.pp system$(PPUEXT)
+        $(COMPILER) $(INC)/macpas.pp $(REDIR)
         
 #
 # Other system-independent RTL Units
@@ -210,11 +218,35 @@ heaptrc$(PPUEXT) : $(INC)/heaptrc.pp system$(PPUEXT)
 
 lineinfo$(PPUEXT) : $(INC)/lineinfo.pp system$(PPUEXT)
 
+lnfodwrf$(PPUEXT) : $(INC)/lnfodwrf.pp $(SYSTEMUNIT)$(PPUEXT) strings$(PPUEXT)
+
+charset$(PPUEXT) : $(INC)/charset.pp objpas$(PPUEXT)
+
+ucomplex$(PPUEXT) : $(INC)/ucomplex.pp math$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) math$(PPUEXT)
+
 #
 # Other system-dependent RTL Units
 #
 
+termio$(PPUEXT) : baseunix$(PPUEXT)
+
+mouse$(PPUEXT) : baseunix$(PPUEXT) video$(PPUEXT)
+        $(COMPILER) $(UNIXINC)/mouse.pp $(REDIR) -dNOGPM
+
+dl$(PPUEXT) : $(SYSTEMUNIT)$(PPUEXT) unixtype$(PPUEXT)
+
 sockets$(PPUEXT) : $(UNIXINC)/sockets.pp $(INC)/textrec.inc $(INC)/filerec.inc \
                    unix$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 
 dynlibs$(PPUEXT) : $(INC)/dynlibs.pas $(UNIXINC)/dynlibs.inc dl$(PPUEXT) objpas$(PPUEXT)
+
+cmem$(PPUEXT) : $(INC)/cmem.pp $(SYSTEMUNIT)$(PPUEXT)
+
+ctypes$(PPUEXT) :  $(INC)/ctypes.pp $(SYSTEMUNIT)$(PPUEXT)
+
+variants$(PPUEXT) : $(INC)/variants.pp sysutils$(PPUEXT) sysconst$(PPUEXT) varutils$(PPUEXT) typinfo$(PPUEXT) rtlconsts$(PPUEXT) math$(PPUEXT)
+        $(COMPILER) -Fi$(INC) $(INC)/variants.pp
+
+cwstring$(PPUEXT) : $(UNIXINC)/cwstring.pp $(SYSTEMUNIT)$(PPUEXT) sysutils$(PPUEXT) baseunix$(PPUEXT) unix$(PPUEXT) unixtype$(PPUEXT) ctypes$(PPUEXT)
+
+

+ 0 - 12
rtl/beos/baseunix.pp

@@ -55,11 +55,9 @@ property errno : cint read fpgeterrno write fpseterrno;
 {$ifdef FPC_USE_LIBC}
 {$ifdef beos}
 function  fpsettimeofday(tp:ptimeval;tzp:ptimezone):cint;
-Function fStatFS(Fd:Longint;Var Info:tstatfs):cint;
 Function fpFlock (var fd : text; mode : longint) : cint; 
 Function fpFlock (var fd : File; mode : longint) : cint; 
 Function fpFlock (fd, mode : longint) : cint; 
-Function StatFS  (Path:string;Var Info:tstatfs):cint; 
 Function  FpNanoSleep  (req : ptimespec;rem : ptimespec):cint;
 {$endif}
 {$endif}
@@ -126,11 +124,6 @@ begin
   fpsettimeofday := settimeofday(tp, tzp);
 end;
 
-Function fStatFS(Fd:Longint;Var Info:tstatfs):cint;
-begin
-  {$warning TODO BeOS fStatFS implementation}  
-end;
-
 Function fpFlock (var fd : File; mode : longint) : cint; 
 begin
   {$warning TODO BeOS fpFlock implementation}  
@@ -146,11 +139,6 @@ begin
   {$warning TODO BeOS fpFlock implementation}  
 end;
 
-Function StatFS  (Path:string;Var Info:tstatfs):cint; 
-begin
-  {$warning TODO BeOS StatFS implementation}  
-end;
-
 Function  FpNanoSleep  (req : ptimespec;rem : ptimespec):cint;
 begin
   {$warning TODO BeOS FpNanoSleep implementation}  

+ 13 - 10
rtl/beos/osmacro.inc

@@ -61,29 +61,32 @@ end;
 
 function wifexited(status : cint): boolean;
 begin
- wifexited:=(status AND 127) =0;
+ wifexited:=(status AND (not $FF)) = 0;
 end;
 
 function wexitstatus(status : cint): cint;
 begin
- wexitstatus:=status shr 8;
+ wexitstatus:=status AND $FF;
 end;
 
-function wstopsig(status : cint): cint;
-begin
- wstopsig:=status shr 8;
-end;
-
-const wstopped=127;
+// const wstopped=127;
 
 function wifsignaled(status : cint): boolean;
 begin
- wifsignaled:=((status and 127)<>wstopped) and ((status and 127)<>0);
+ wifsignaled := ((status shr 8) AND $FF) <> 0;
 end;
 
 function wtermsig(status : cint):cint;
+begin
+ wtermsig:= ((status shr 8) AND $FF);
+end;
 
+function wstopsig(status : cint): cint;
 begin
- wtermsig:=cint(status and 127);
+ wstopsig:=((status shr 16) AND $FF);
 end;
 
+
+
+
+

+ 0 - 183
rtl/beos/osposixh.inc

@@ -1,183 +0,0 @@
-{
-    This file is part of the Free Pascal run time library.
-    Copyright (c) 2001 by Free Pascal development team
-
-    This file implements all the types used in POSIX for BeOS
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- **********************************************************************}
-
-{***********************************************************************}
-{                       POSIX TYPE DEFINITIONS                          }
-{***********************************************************************}
-
-type
-    { the following type definitions are compiler dependant }
-    { and system dependant                                  }
-
-    cint  = longint;       { minimum range is : 32-bit                   }
-    cuint = cardinal;      { minimum range is : 32-bit                   }
-
-
-    dev_t  = cint;             { used for device numbers      }
-    gid_t  = cuint;            { used for group IDs           }
-    ino_t  = int64;           { used for file serial numbers }
-    mode_t = cuint;            { used for file attributes     }
-    nlink_t  = cint;           { used for link counts         }
-    off_t  = int64;           { used for file sizes          }
-    pid_t  = cint;             { used as process identifier   }
-    size_t = cint;             { as definied in the C standard }
-    ssize_t = cint;            { used by function for returning number of bytes }
-    uid_t =  cuint;            { used for user ID type        }
-    time_t = cint;             { used for returning the time  }
-    sigset_t = cuint;          { used for additional signal   }
-
-{***********************************************************************}
-{                         POSIX STRUCTURES                              }
-{***********************************************************************}
-CONST
-    _UTSNAME_LENGTH = 32;
-    _UTSNAME_NODENAME_LENGTH = _UTSNAME_LENGTH;
-
-TYPE
-   { system information services }
-   utsname = packed record   { don't forget to verify the alignment }
-     { Name of this implementation of the operating systems (POSIX) }
-     sysname : array[0.._UTSNAME_LENGTH+1] of char;
-     { Name of this node (POSIX) }
-     nodename : array[0.._UTSNAME_NODENAME_LENGTH+1] of char;
-     { Current release level of this implementation (POSIX) }
-     release : array[0.._UTSNAME_LENGTH+1] of char;
-     { Current version level of this release (POSX) }
-     version : array[0.._UTSNAME_LENGTH+1] of char;
-     { Name of the hardware type on which the system is running (POSIX) }
-     machine : array[0.._UTSNAME_LENGTH+1] of char;
-   end;
-
-  { file characteristics services }
-   stat = packed record { verify the alignment of the members }
-    st_dev : dev_t;     { Device containing the file (POSIX) }
-    st_ino : ino_t;		{ File serial number (POSIX)         }
-    st_mode: mode_t;	{ File mode (POSIX)                  }
-    st_nlink: nlink_t;	{ Link count (POSIX)                 }
-    st_uid: uid_t;		{ User ID of the file's owner. (POSIX)}
-    st_gid: gid_t;		{ Group ID of the file's group.(POSIX)}
-    st_size : off_t;	{ Size of file, in bytes.      (POSIX)}
-    st_rdev : dev_t;	{ Device type (not used).            }
-    st_blksize: cardinal;{ Preferred block size for I/O.     }
-    st_atime: time_t;   { Time of last access (POSIX)        }
-    st_mtime: time_t;	{ Time of last modification (POSIX)  }
-    st_ctime: time_t;	{ Time of last status change (POSIX) }
-    st_crtime: time_t;	{ Time of creation                   }
-  end;
-
-  { directory services }
-   pdirent = ^dirent;
-   dirent = packed record    { directory entry record - verify alignment }
-	 d_dev: dev_t;
-	 d_pdev: dev_t;
-	 d_fileno: ino_t;
-	 d_pino: ino_t;
-	 d_reclen:word;
-	 d_name:array[0..255] of char;      { Filename in DIRENT (POSIX) }
-   end;
-
-   pdir = ^dir;
-   dir = packed record
-     fd : cint;         { file descriptor }
-     ent : dirent;     { directory entry }
-   end;
-
-   sighandler_t = procedure (signo: cint); cdecl;
-
-   { signal services }
-   sigactionrec = packed record
-     sa_handler : sighandler_t;  { pointer to a function (POSIX.1)     }
-     sa_mask : sigset_t;         { additional signal masks  (POSIX.1)  }
-     sa_flags : cint;             { special flags for signals (POSIX.1) }
-     sa_userdata : pointer;
-   end;
-
-{***********************************************************************}
-{                  POSIX CONSTANT ROUTINE DEFINITIONS                   }
-{***********************************************************************}
-CONST
-    { access routine - these maybe OR'ed together }
-    F_OK        =  0;   { test for existence of file }
-    R_OK        =  4;   { test for read permission on file }
-    W_OK        =  2;   { test for write permission on file }
-    X_OK        =  1;   { test for execute or search permission }
-    { seek routine }
-    SEEK_SET    =  0;    { seek from beginning of file }
-    SEEK_CUR    =  1;    { seek from current position  }
-    SEEK_END    =  2;    { seek from end of file       }
-    { open routine                                 }
-    { File access modes for `open' and `fcntl'.    }
-    O_RDONLY    =  0;	{ Open read-only.  }
-    O_WRONLY    =  1;	{ Open write-only. }
-    O_RDWR      =  2;	{ Open read/write. }
-    O_RWMASK    =  3; { Mask to get open mode. }
-    { Bits OR'd into the second argument to open.  }
-    O_CREAT     =$0200;	{ Create file if it doesn't exist.  }
-    O_TEXT      =$4000;
-    O_BINARY    =$8000;
-    
-    O_EXCL      =$0100;	{ Fail if file already exists.      }
-    O_TRUNC     =$0400;	{ Truncate file to zero length.     }
-    O_NOCTTY    =$1000;	{ Don't assign a controlling terminal. }
-    { File status flags for `open' and `fcntl'.  }
-    O_APPEND    =$0800;	{ Writes append to the file.        }
-    O_NONBLOCK	=$0080;	{ Non-blocking I/O.                 }
-
-    { mode_t possible values                                 }
-    S_IRUSR = $0100;           { Read permission for owner   }
-    S_IWUSR = $0080;           { Write permission for owner  }
-    S_IXUSR = $0040;           { Exec  permission for owner  }
-    S_IRGRP = S_IRUSR shr 3;   { Read permission for group   }
-    S_IWGRP = S_IWUSR shr 3;   { Write permission for group  }
-    S_IXGRP = S_IWUSR shr 3;   { Exec permission for group   }
-    S_IROTH = S_IRGRP shr 3;   { Read permission for world   }
-    S_IWOTH = S_IWGRP shr 3;   { Write permission for world  }
-    S_IXOTH = S_IXGRP shr 3;   { Exec permission for world   }
-
-    { Used for waitpid }
-    WNOHANG   = 1;               { don't block waiting               }
-    WUNTRACED = 2;               { report status of stopped children }
-
-
-    {************************ signals *****************************}
-    { more can be provided. Herein are only included the required  }
-    { values.                                                      }
-    {**************************************************************}
-    SIGABRT    =  6;     { abnormal termination           }
-    SIGALRM    = 14;     { alarm clock (used with alarm() }
-    SIGFPE     =  8;     { illegal arithmetic operation   }
-    SIGHUP     =  1;     { Hangup                         }
-    SIGILL     =  4;     { Illegal instruction            }
-    SIGINT     =  2;     { Interactive attention signal   }
-    SIGKILL    =  9;     { Kill, cannot be caught         }
-    SIGPIPE    =  7;     { Broken pipe signal             }
-    SIGQUIT    =  3;     { Interactive termination signal }
-    SIGSEGV    = 11;     { Detection of invalid memory reference }
-    SIGTERM    = 15;     { Termination request           }
-    SIGUSR1    = 18;     { Application defined signal 1  }
-    SIGUSR2    = 19;     { Application defined signal 2  }
-    SIGCHLD    =  5;     { Child process terminated / stopped }
-    SIGCONT    = 12;     { Continue if stopped                }
-    SIGSTOP    = 10;     { Stop signal. cannot be cuaght      }
-    SIGSTP     = 13;     { Interactive stop signal            }
-    SIGTTIN    = 16;     { Background read from TTY           }
-    SIGTTOU    = 17;     { Background write to TTY            }
-    SIGBUS     = SIGSEGV; { Access to undefined memory        }
-
-
-    { POSIX limits }
-    ARG_MAX =  128*1024; { Maximum number of arguments           }
-    NAME_MAX = 256;      { Maximum number of bytes in a filename }
-    PATH_MAX = 1024;     { Maximum number of bytes in a pathname }

+ 15 - 14
rtl/beos/ostypes.inc

@@ -58,16 +58,17 @@ Type
 { auto generated by a c prog, statmacr.c}
 
 Const
-  S_IFMT  = 61440;
-  S_IFIFO = 4096;
-  S_IFCHR = 8192;
-  S_IFDIR = 16384;
-  S_IFBLK = 24576;
-  S_IFREG = 32768;
-  S_IFLNK = 40960;
-  S_IFSOCK= 49152;
-  S_IFWHT = 57344;
-  S_ISVTX = 512;
+  S_IFMT  = &0000170000;
+  S_IFLNK = &0000120000;
+  S_IFREG = &0000100000;
+  S_IFBLK = &0000060000;
+  S_IFDIR = &0000040000;
+  S_IFCHR = &0000020000;
+  S_IFIFO = &0000010000;
+
+  S_IFSOCK= &0000000000; // not defined under BeOS
+  S_IFWHT = &0000000000; // not defined under BeOS
+  S_ISVTX = &1000;
 
 //      CONST SYS_NMLN=32;
 
@@ -241,12 +242,12 @@ CONST
     O_RDWR      =     2;        { Open read/write. }
     { Bits OR'd into the second argument to open.  }
     O_CREAT     =  $200;        { Create file if it doesn't exist.  }
-    O_EXCL      =  $800;        { Fail if file already exists.      }
+    O_EXCL      =  $100;        { Fail if file already exists.      }
     O_TRUNC     =  $400;        { Truncate file to zero length.     }
-    O_NOCTTY    = $8000;        { Don't assign a controlling terminal. }
+    O_NOCTTY    = $1000;        { Don't assign a controlling terminal. }
     { File status flags for `open' and `fcntl'.  }
-    O_APPEND    =     8;        { Writes append to the file.        }
-    O_NONBLOCK  =     4;        { Non-blocking I/O.                 }
+    O_APPEND    =  $800;        { Writes append to the file.        }
+    O_NONBLOCK  = $0080;        { Non-blocking I/O.                 }
 
     { mode_t possible values                                 }
     S_IRUSR =  %0100000000;     { Read permission for owner   }

+ 20 - 17
rtl/beos/ptypes.inc

@@ -22,23 +22,19 @@
 {$i ctypes.inc}
 
 type
+  fsblkcnt_t = clonglong;
   TStatfs = packed record
-    spare2,            { place holder}
-    bsize,             { fundamental block size}
-    iosize,            { optimal block size }
-    blocks,            {  total blocks}
-    bfree,             { blocks free}
-    bavail,            { block available for mortal users}
-    files,             { Total file nodes}
-    ffree          : longint;    { file nodes free}
-    fsid           : array[0..1] of longint;
-    fowner         : longint; {mounter uid}
-    ftype          : longint;
-    fflags         : longint; {copy of mount flags}
-    spare          : array [0..1] of longint; { For later use }
-    fstypename     : array[0..15] of char;
-    mountpoint     : array[0..89] of char;
-    mnfromname     : array[0..89] of char;
+    bsize 			: Cardinal;
+    frsize			: Cardinal;
+    blocks			: fsblkcnt_t;
+    bfree			: fsblkcnt_t;
+    bavail			: fsblkcnt_t;
+    files			: fsblkcnt_t;
+    ffree			: fsblkcnt_t;
+    favail			: fsblkcnt_t;
+    fsid			: Cardinal;
+    flag			: Cardinal;
+    namemax			: Cardinal;
   end;
   PStatFS=^TStatFS;
 
@@ -70,9 +66,11 @@ type
     TPid     = pid_t;
     pPid     = ^pid_t;
 
+    wint_t	 = cint32;
     size_t   = cuint32;         { as definied in the C standard}
     TSize    = size_t;
-    pSize    = ^size_t;		
+    pSize    = ^size_t;
+    psize_t   = pSize;		
 
     ssize_t  = cint32;          { used by function for returning number of bytes }
     TsSize   = ssize_t;
@@ -91,6 +89,8 @@ type
     pTime    = ^time_t;
     ptime_t =  ^time_t;
     
+    wchar_t   = widechar;
+    pwchar_t  = ^wchar_t;
 
     socklen_t= cuint32;
     TSocklen = socklen_t;
@@ -193,6 +193,9 @@ CONST
     _PTHREAD_MUTEX_DEFAULT    = _PTHREAD_MUTEX_NORMAL;
     _PTHREAD_MUTEX_FAST_NP    = _PTHREAD_MUTEX_ADAPTIVE_NP;
 
+     _PTHREAD_KEYS_MAX              = 256;
+     _PTHREAD_STACK_MIN             = 1024;
+
 CONST
    { System limits, POSIX value in parentheses, used for buffer and stack allocation }
     ARG_MAX  = 65536;   {4096}  { Maximum number of argument size     }

+ 146 - 6
rtl/beos/signal.inc

@@ -81,8 +81,144 @@ const
  }
 
 type 
-  // sigset_t = clong; ??? BeOS ? should be this...
-  sigset_t = array[0..3] of Longint;  // here for compiling...
+  packed_fp_stack = packed record
+    st0 : array[0..9] of byte;
+    st1 : array[0..9] of byte;
+    st2 : array[0..9] of byte;
+    st3 : array[0..9] of byte;
+    st4 : array[0..9] of byte;
+    st5 : array[0..9] of byte;
+    st6 : array[0..9] of byte;    
+    st7 : array[0..9] of byte;    
+  end;
+  
+  packed_mmx_regs = packed record
+    mm0 : array[0..9] of byte;
+    mm1 : array[0..9] of byte;
+    mm2 : array[0..9] of byte;
+    mm3 : array[0..9] of byte;
+    mm4 : array[0..9] of byte;
+    mm5 : array[0..9] of byte;
+    mm6 : array[0..9] of byte;    
+    mm7 : array[0..9] of byte;    
+  end;
+  
+  old_extended_regs = packed record
+    fp_control 	: word;
+    _reserved1 	: word;
+    fp_status 	: word;
+    _reserved2 	: word;
+    fp_tag 		: word;
+    _reserved3 	: word;
+    fp_eip 		: cardinal;
+    fp_cs 		: word;
+    fp_opcode	: word;
+    fp_datap	: word;
+    fp_ds		: word;
+    _reserved4	: word;
+    fp_mmx : record
+      case fp_mmx : byte of
+        0 : (fp	: packed_fp_stack);
+        1 : (mmx	: packed_mmx_regs);
+    end;
+  end;
+  
+  fp_stack = record
+    st0 : array[0..9] of byte;
+    _reserved_42_47 : array[0..5] of byte;
+    st1 : array[0..9] of byte;
+    _reserved_58_63 : array[0..5] of byte;
+    st2 : array[0..9] of byte;
+    _reserved_74_79 : array[0..5] of byte;
+    st3 : array[0..9] of byte;
+    _reserved_90_95 : array[0..5] of byte;
+    st4 : array[0..9] of byte;
+    _reserved_106_111 : array[0..5] of byte;
+    st5 : array[0..9] of byte;
+    _reserved_122_127 : array[0..5] of byte;
+    st6 : array[0..9] of byte;    
+    _reserved_138_143 : array[0..5] of byte;
+    st7 : array[0..9] of byte;        
+    _reserved_154_159 : array[0..5] of byte;
+  end;
+  
+  mmx_regs = record
+    mm0 : array[0..9] of byte;
+    _reserved_42_47 : array[0..5] of byte;
+    mm1 : array[0..9] of byte;
+    _reserved_58_63 : array[0..5] of byte;
+    mm2 : array[0..9] of byte;
+    _reserved_74_79 : array[0..5] of byte;
+    mm3 : array[0..9] of byte;
+    _reserved_90_95 : array[0..5] of byte;
+    mm4 : array[0..9] of byte;
+    _reserved_106_111 : array[0..5] of byte;
+    mm5 : array[0..9] of byte;
+    _reserved_122_127 : array[0..5] of byte;
+    mm6 : array[0..9] of byte;    
+    _reserved_138_143 : array[0..5] of byte;
+    mm7 : array[0..9] of byte;    
+    _reserved_154_159 : array[0..5] of byte;
+  end;
+  
+  xmmx_regs = record
+    xmm0 : array [0..15] of byte;
+    xmm1 : array [0..15] of byte;
+    xmm2 : array [0..15] of byte;
+    xmm3 : array [0..15] of byte;
+    xmm4 : array [0..15] of byte;
+    xmm5 : array [0..15] of byte;
+    xmm6 : array [0..15] of byte;
+    xmm7 : array [0..15] of byte;
+  end;
+  
+  new_extended_regs = record
+    fp_control 	: word;
+    fp_status 	: word;
+    fp_tag		: word;
+    fp_opcode	: word;
+    fp_eip		: Cardinal;
+    fp_cs		: word;
+    res_14_15	: word;
+    fp_datap	: Cardinal;
+    fp_ds		: word;
+    _reserved_22_23 : word;
+    mxcsr		: Cardinal;
+    _reserved_28_31 : Cardinal;
+    fp_mmx : record
+      case byte of
+        0 : (fp : fp_stack);
+        1 : (mmx : mmx_regs);
+    end;
+    xmmx : xmmx_regs;
+    _reserved_288_511 : array[0..223] of byte;
+  end;
+  
+  extended_regs = record
+    state : record
+      case byte of
+  	    0 : (old_format : old_extended_regs);
+  	    1 : (new_format : new_extended_regs);  	  
+  	end;
+  	format	: Cardinal;
+  end;
+  
+  vregs = record
+    eip 	: Cardinal;
+    eflags 	: cardinal;
+    eax		: Cardinal;
+    ecx		: Cardinal;
+    edx		: Cardinal;
+    esp		: Cardinal;
+    ebp		: Cardinal;
+    _reserved_1 : Cardinal;
+    xregs	: extended_regs;
+    _reserved_2 : array[0..2] of Cardinal;
+  end;
+  
+  Pvregs = ^vregs;
+
+  sigset_t = array[0..3] of Longint;
 
     PSigContextRec = ^SigContextRec;
     SigContextRec = record
@@ -125,17 +261,18 @@ type
        fpr_ex_sw    : cardinal;
        fpr_pad      : array[0..63] of char;
        end;
-
+       
   SignalHandler   = Procedure(Sig : Longint);cdecl;
   PSignalHandler  = ^SignalHandler;
   SignalRestorer  = Procedure;cdecl;
   PSignalRestorer = ^SignalRestorer;
   {$WARNING TODO : check with signal.h}
-  sigActionHandler = procedure(Sig: Longint; SigContext: SigContextRec;someptr:pointer);cdecl;
+  sigActionHandler = procedure(Sig: Longint; SigContext: PSigContextRec; uContext : Pvregs);cdecl;
 
   Sigset=sigset_t;
   TSigset=sigset_t;
   PSigSet = ^SigSet;
+  psigset_t=psigset;
 
   SigActionRec = packed record
 //    Handler  : record
@@ -144,8 +281,9 @@ type
 //        0: (Sh: SignalHandler);
 //        1: (Sa: TSigAction);
 //      end;
-    Sa_Flags    : Longint;
-    Sa_Mask     : SigSet;
+    sa_Mask     : SigSet;
+    sa_Flags    : Longint;
+    sa_userdaa  : pointer
   end;
 
   PSigActionRec = ^SigActionRec;
@@ -157,3 +295,5 @@ type
   If OldAct is non-nil the previous action is saved there.
 }
 
+
+

+ 0 - 129
rtl/beos/sysdir.inc

@@ -1,129 +0,0 @@
-Procedure MkDir(Const s: String);[IOCheck];
-Var
-  Buffer: Array[0..255] of Char;
-Begin
-  {$warning TODO BeOS MkDir implementation}
-{  If (s='') or (InOutRes <> 0) then
-   exit;
-  Move(s[1], Buffer, Length(s));
-  Buffer[Length(s)] := #0;
-  If Fpmkdir(@buffer, MODE_MKDIR)<0 Then
-   Errno2Inoutres
-  Else
-   InOutRes:=0;
-}
-End;
-
-
-Procedure RmDir(Const s: String);[IOCheck];
-Var
-  Buffer: Array[0..255] of Char;
-Begin
-  {$warning TODO BeOS RmDir implementation}
-{  if (s = '.') then
-    InOutRes := 16;
-  If (s='') or (InOutRes <> 0) then
-   exit;
-  Move(s[1], Buffer, Length(s));
-  Buffer[Length(s)] := #0;
-  If Fprmdir(@buffer)<0 Then
-   Errno2Inoutres
-  Else
-   InOutRes:=0;
-}
-End;
-
-
-Procedure ChDir(Const s: String);[IOCheck];
-Var
-  Buffer: Array[0..255] of Char;
-Begin
-  {$warning TODO BeOS ChDir implementation}
-{  If (s='') or (InOutRes <> 0) then
-   exit;
-  Move(s[1], Buffer, Length(s));
-  Buffer[Length(s)] := #0;
-  If Fpchdir(@buffer)<0 Then
-   Errno2Inoutres
-  Else
-   InOutRes:=0;
-  { file not exists is path not found under tp7 }
-  if InOutRes=2 then
-   InOutRes:=3;
-}
-End;
-
-{ // $define usegetcwd}
-
-procedure getdir(drivenr : byte;var dir : shortstring);
-var
-{$ifndef usegetcwd}
-  cwdinfo      : stat;
-  rootinfo     : stat;
-  thedir,dummy : string[255];
-  dirstream    : pdir;
-  d            : pdirent;
-  name         : string[255];
-  thisdir      : stat;
-{$endif}
-  tmp          : string[255];
-
-begin
-{$ifdef usegetcwd}
- Fpgetcwd(@tmp[1],4096);
- dir:=tmp;
-{$else}
-  dir:='';
-  thedir:='';
-  dummy:='';
-
-  { get root directory information }
-  tmp := '/'+#0;
-  if Fpstat(@tmp[1],rootinfo)<0 then
-    Exit;
-  repeat
-    tmp := dummy+'.'+#0;
-    { get current directory information }
-    if Fpstat(@tmp[1],cwdinfo)<0 then
-      Exit;
-    tmp:=dummy+'..'+#0;
-    { open directory stream }
-    { try to find the current inode number of the cwd }
-    dirstream:=Fpopendir(@tmp[1]);
-    if dirstream=nil then
-       exit;
-    repeat
-      name:='';
-      d:=Fpreaddir(dirstream);
-      { no more entries to read ... }
-      if not assigned(d) then
-        break;
-      tmp:=dummy+'../'+strpas(d^.d_name) + #0;
-      if (Fpstat(@tmp[1],thisdir)=0) then
-       begin
-         { found the entry for this directory name }
-         if (cwdinfo.dev=thisdir.dev) and (cwdinfo.ino=thisdir.ino) then
-          begin
-            { are the filenames of type '.' or '..' ? }
-            { then do not set the name.               }
-            if (not ((d^.d_name[0]='.') and ((d^.d_name[1]=#0) or
-                    ((d^.d_name[1]='.') and (d^.d_name[2]=#0))))) then
-              name:='/'+strpas(d^.d_name);
-          end;
-       end;
-    until (name<>'');
-    if Fpclosedir(dirstream)<0 then
-      Exit;
-    thedir:=name+thedir;
-    dummy:=dummy+'../';
-    if ((cwdinfo.dev=rootinfo.dev) and (cwdinfo.ino=rootinfo.ino)) then
-      begin
-        if thedir='' then
-          dir:='/'
-        else
-          dir:=thedir;
-        exit;
-      end;
-  until false;
- {$endif}
-end;

+ 0 - 235
rtl/beos/sysfile.inc

@@ -1,235 +0,0 @@
-{
-    This file is part of the Free Pascal run time library.
-
-    Main OS dependant body of the system unit, loosely modelled
-    after POSIX.  *BSD version (Linux version is near identical)
-
-    See the file COPYING.FPC, included in this distribution,
-    for details about the copyright.
-
-    This program is distributed in the hope that it will be useful,
-    but WITHOUT ANY WARRANTY; without even the implied warranty of
-    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
- **********************************************************************}
-Procedure Do_Close(Handle:thandle);
-Begin
-  Fpclose(cint(Handle));
-End;
-
-Procedure Do_Erase(p:pchar);
-var
- fileinfo : stat;
-Begin
-  { verify if the filename is actually a directory }
-  { if so return error and do nothing, as defined  }
-  { by POSIX                                       }
-  if Fpstat(p,fileinfo)<0 then
-   begin
-     Errno2Inoutres;
-     exit;
-   end;
-  if FpS_ISDIR(fileinfo.st_mode) then
-   begin
-     InOutRes := 2;
-     exit;
-   end;
-  if Fpunlink(p)<0 then
-   Errno2Inoutres
-  Else
-   InOutRes:=0;
-End;
-
-{ truncate at a given position }
-procedure do_truncate (handle:thandle;fpos:longint);
-begin
-  { should be simulated in cases where it is not }
-  { available.                                   }
-  If Fpftruncate(handle,fpos)<0 Then
-   Errno2Inoutres
-  Else
-   InOutRes:=0;
-end;
-
-
-
-Procedure Do_Rename(p1,p2:pchar);
-Begin
-  If Fprename(p1,p2)<0 Then
-   Errno2Inoutres
-  Else
-   InOutRes:=0;
-End;
-
-
-Function Do_Write(Handle:thandle;Addr:Pointer;Len:Longint):longint;
-
-var j : cint;
-Begin
-  repeat
-    Do_Write:=Fpwrite(Handle,addr,len);
-    j:=geterrno;
-  until (do_write<>-1) or ((j<>ESysEINTR) and (j<>ESysEAgain));
-  If Do_Write<0 Then
-   Begin
-    Errno2InOutRes;
-    Do_Write:=0;
-   End
-  else
-   InOutRes:=0;
-End;
-
-
-Function Do_Read(Handle:thandle;Addr:Pointer;Len:Longint):Longint;
-
-var j:cint;
-
-Begin
-  repeat
-    Do_Read:=Fpread(Handle,addr,len);
-    j:=geterrno;
-  until (do_read<>-1) or ((j<>ESysEINTR) and (j<>ESysEAgain));
-  If Do_Read<0 Then
-   Begin
-    Errno2InOutRes;
-    Do_Read:=0;
-   End
-  else
-   InOutRes:=0;
-End;
-
-function Do_FilePos(Handle: thandle):longint;
-Begin
-  do_FilePos:=Fplseek(Handle, 0, SEEK_CUR);
-  If Do_FilePos<0 Then
-    Errno2InOutRes
-  else
-   InOutRes:=0;
-End;
-
-Procedure Do_Seek(Handle:thandle;Pos:Longint);
-Begin
-  If Fplseek(Handle, pos, SEEK_SET)<0 Then
-   Errno2Inoutres
-  Else
-   InOutRes:=0;
-End;
-
-Function Do_SeekEnd(Handle:thandle): Longint;
-begin
-  Do_SeekEnd:=Fplseek(Handle,0,SEEK_END);
-  If Do_SeekEnd<0 Then
-   Errno2Inoutres
-  Else
-   InOutRes:=0;
-end;
-
-Function Do_FileSize(Handle:thandle): Longint;
-var
-  Info : Stat;
-  Ret  : Longint;
-Begin
-  Ret:=Fpfstat(handle,info);
-  If Ret=0 Then
-   Do_FileSize:=Info.st_size
-  else
-   Do_FileSize:=0;
-  If Ret<0 Then
-   Errno2InOutRes
-  Else
-   InOutRes:=0;
-End;
-
-Procedure Do_Open(var f;p:pchar;flags:longint);
-{
-  FileRec and textrec have both Handle and mode as the first items so
-  they could use the same routine for opening/creating.
-  when (flags and $100)   the file will be append
-  when (flags and $1000)  the file will be truncate/rewritten
-  when (flags and $10000) there is no check for close (needed for textfiles)
-}
-const
-  { read/write permission for everyone }
-  MODE_OPEN = S_IWUSR OR S_IRUSR OR
-              S_IWGRP OR S_IRGRP OR
-              S_IWOTH OR S_IROTH;
-var
-  oflags : cint;
-Begin
-{ close first if opened }
-  if ((flags and $10000)=0) then
-   begin
-     case FileRec(f).mode of
-      fminput,fmoutput,fminout : Do_Close(FileRec(f).Handle);
-      fmclosed : ;
-     else
-      begin
-        inoutres:=102; {not assigned}
-        exit;
-      end;
-     end;
-   end;
-{ reset file Handle }
-  FileRec(f).Handle:=UnusedHandle;
-{ We do the conversion of filemodes here, concentrated on 1 place }
-  case (flags and 3) of
-   0 : begin
-         oflags :=O_RDONLY;
-         FileRec(f).mode:=fminput;
-       end;
-   1 : begin
-         oflags :=O_WRONLY;
-         FileRec(f).mode:=fmoutput;
-       end;
-   2 : begin
-         oflags :=O_RDWR;
-         FileRec(f).mode:=fminout;
-       end;
-  end;
-  if (flags and $1000)=$1000 then
-   oflags:=oflags or (O_CREAT or O_TRUNC)
-  else
-   if (flags and $100)=$100 then
-    oflags:=oflags or (O_APPEND);
-{ empty name is special }
-  if p[0]=#0 then
-   begin
-     case FileRec(f).mode of
-       fminput :
-         FileRec(f).Handle:=StdInputHandle;
-       fminout, { this is set by rewrite }
-       fmoutput :
-         FileRec(f).Handle:=StdOutputHandle;
-       fmappend :
-         begin
-           FileRec(f).Handle:=StdOutputHandle;
-           FileRec(f).mode:=fmoutput; {fool fmappend}
-         end;
-     end;
-     exit;
-   end;
-{ real open call }
-  FileRec(f).Handle:=Fpopen(p,oflags,MODE_OPEN);
-  if (FileRec(f).Handle<0) and
-    (getErrNo=ESysEROFS) and ((OFlags and O_RDWR)<>0) then
-   begin
-     Oflags:=Oflags and not(O_RDWR);
-     FileRec(f).Handle:=Fpopen(p,oflags,MODE_OPEN);
-   end;
-  If Filerec(f).Handle<0 Then
-   Errno2Inoutres
-  else
-   InOutRes:=0;
-End;
-
-
-{
-  $Log: sysfile.inc,v $
-  Revision 1.1  2005/02/07 22:04:55  peter
-    * moved to unix
-
-  Revision 1.1  2005/02/06 13:06:20  peter
-    * moved file and dir functions to sysfile/sysdir
-    * win32 thread in systemunit
-
-}

+ 1 - 0
rtl/beos/sysos.inc

@@ -109,6 +109,7 @@ begin
    ESysENOTEMPTY,
    ESysEACCES : Inoutres:=5;
    ESysEISDIR : InOutRes:=5;
+   ESysEPERM  : InOutRes:=5;
   else
     begin
        InOutRes := Integer(PosixErrno);

+ 48 - 276
rtl/beos/system.pp

@@ -2,7 +2,7 @@ Unit system;
 
 interface
 
-// Was needed too bootstrap with our old 2.1 fpc for BeOS
+// Was needed to bootstrap with our old 2.1 fpc for BeOS
 // to define real
 { $define VER2_0}
 
@@ -22,6 +22,8 @@ var
 implementation
 
 procedure debugger(s : PChar); cdecl; external 'root' name 'debugger';
+
+function disable_debugger(state : integer): integer; external 'root' name 'disable_debugger';
 //begin
 //end;
 
@@ -179,278 +181,6 @@ function sys_resize_area (handle:cardinal; size:longint):longint; cdecl; externa
 *)
 //end;
 
-{****************************************************************************
-                        Low level File Routines
-       All these functions can set InOutRes on errors
- ****************************************************************************}
-
-
-(*
-{ close a file from the handle value }
-procedure do_close(handle : longint);
-begin
-  if handle<=2 then exit;
-  InOutRes := fpclose(handle);
-end;
-
-
-procedure do_erase(p : pchar);
-begin
-  if fpunlink(p)<>0 then InOutRes:=1
-  else InOutRes:=0;
-end;
-
-procedure do_rename(p1,p2 : pchar);
-begin
-  InOutRes := fprename(p1, p2);
-end;
-
-function do_write(h : longint; addr : pointer; len : longint) : longint;
-begin
-  do_write := fpwrite (h,addr,len);
-  if (do_write<0) then begin
-    InOutRes:=do_write;
-    do_write:=0;
-  end else InOutRes:=0;
-end;
-
-function do_read(h:longint; addr : Pointer; len : longint) : longint;
-begin
-  do_read := fpread (h,addr,len);
-  if (do_read<0) then begin
-    InOutRes:=do_read;
-    do_read:=0;
-  end else InOutRes:=0;
-end;
-
-function do_filepos(handle : longint) : longint;
-begin
-  do_filepos := fplseek(handle,0,1); {1=SEEK_CUR}
-  if (do_filepos<0) then begin
-    InOutRes:=do_filepos;
-    do_filepos:=0;
-  end else InOutRes:=0;
-end;
-
-procedure do_seek(handle,pos : longint);
-begin
-  InOutRes := fplseek(handle,pos,0);
-  if InOutRes>0 then InOutRes:=0;
-end;
-
-function do_seekend(handle:longint):longint;
-begin
-  do_seekend := fplseek (handle,0,2); {2=SEEK_END}
-  if do_seekend<0 then begin
-    InOutRes:=do_seekend;
-    do_seekend:=0;
-  end else InOutRes:=0;
-end;
-
-function do_filesize(handle : longint) : longint;
-var cur:longint;
-begin
-  cur := fplseek (handle,0,1); {1=SEEK_CUR}
-  if cur<0 then begin
-    InOutRes:=cur;
-    do_filesize:=0;
-    exit;
-  end;
-  do_filesize := fplseek (handle,0,2); {2=SEEK_END}
-  if do_filesize<0 then begin
-    InOutRes:=do_filesize;
-    do_filesize:=0;
-    exit;
-  end;
-  cur := fplseek (handle,cur,0); {0=SEEK_POS}
-  if cur<0 then begin
-    InOutRes:=cur;
-    do_filesize:=0;
-    exit;
-  end;
-end;
-
-{ truncate at a given position }
-procedure do_truncate (handle,pos:longint);
-begin
-  InOutRes:=1;
-end;
-
-(*procedure do_open(var f;p:pchar;flags:longint);
-{
-  filerec and textrec have both handle and mode as the first items so
-  they could use the same routine for opening/creating.
-  when (flags and $100)   the file will be append
-  when (flags and $1000)  the file will be truncate/rewritten
-  when (flags and $10000) there is no check for close (needed for textfiles)
-}
-var m:longint;
-    mode,h:longint;
-    s : string;
-begin
-//  WriteLn('do_open; -> ');
-//  WriteLn('p : ' + p);
-//  Str(flags, s);
-//  WriteLn('flags : ' + s);
-{  printf ('OPEN %d ',longint(f));
-  printf (' %s',longint(p));
-  printf (' %x',flags);}
-
-  m:=0;
-  case (flags and 3) of
-        0: 
-          begin 
-//            WriteLn('0');
-            m:=m or O_RDONLY; 
-            mode:=fminput;  
-          end;
-        1: 
-          begin 
-//            WriteLn('1');          
-            m:=m or O_WRONLY or O_CREAT; 
-            mode:=fmoutput;
-          end;
-        2: 
-          begin 
-//            WriteLn('2');          
-            m:=m or O_RDWR or O_CREAT; 
-            mode:=fminout; 
-          end;
-        3: 
-          begin 
-//            WriteLn('3');          
-            m:=m or O_APPEND; 
-            mode:=fmAppend; 
-          end;
-  end;
-
-//  if (flags and $100)<>0 then m:=m or O_APPEND;
-{  if (flags and $200)<>0 then 
-  begin
-    WriteLn('Création');
-    m := m or O_CREAT;
-  end;
-}
-
-
-//  if (flags and $1000)<>0 then m:=m {or O_TRUNC} or O_CREAT;
-//  m := m or O_CREAT;
-
-//  if (flags and $10000)<>0 then m:=m or O_TEXT else m:=m or O_BINARY;
-
-  h := fpopen(p, m, mode);
-  Str(mode, s);
-//  WriteLn('mode : ' + s);
-
-//  Str(m, s);
-//  WriteLn('m : ' + s);
-
-//  Str(h, s);
-//  WriteLn('h : ' + s);
-  if h<0 then InOutRes:=h
-  else InOutRes:=0;
-
-  if InOutRes=0 then begin
-    FileRec(f).handle:=h;
-    FileRec(f).mode:=mode;
-  end;
-end;*)
-
-const
-     { Default creation mode for directories and files }
-
-     { read/write permission for everyone }
-     MODE_OPEN = S_IWUSR OR S_IRUSR OR
-                 S_IWGRP OR S_IRGRP OR
-                 S_IWOTH OR S_IROTH;
-     { read/write search permission for everyone }
-     MODE_MKDIR = MODE_OPEN OR
-                 S_IXUSR OR S_IXGRP OR S_IXOTH;
-Procedure Do_Open(var f;p:pchar;flags:longint);
-{
-  FileRec and textrec have both Handle and mode as the first items so
-  they could use the same routine for opening/creating.
-  when (flags and $100)   the file will be append
-  when (flags and $1000)  the file will be truncate/rewritten
-  when (flags and $10000) there is no check for close (needed for textfiles)
-}
-var
-  oflags : cint;
-Begin
-{ close first if opened }
-  if ((flags and $10000)=0) then
-   begin
-     case FileRec(f).mode of
-      fminput,fmoutput,fminout : Do_Close(FileRec(f).Handle);
-      fmclosed : ;
-     else
-      begin
-        inoutres:=102; {not assigned}
-        exit;
-      end;
-     end;
-   end;
-{ reset file Handle }
-  FileRec(f).Handle:=UnusedHandle;
-{ We do the conversion of filemodes here, concentrated on 1 place }
-  case (flags and 3) of
-   0 : begin
-         oflags :=O_RDONLY;
-         FileRec(f).mode:=fminput;
-       end;
-   1 : begin
-         oflags :=O_WRONLY;
-         FileRec(f).mode:=fmoutput;
-       end;
-   2 : begin
-         oflags :=O_RDWR;
-         FileRec(f).mode:=fminout;
-       end;
-  end;
-  if (flags and $1000)=$1000 then
-   oflags:=oflags or (O_CREAT or O_TRUNC)
-  else
-   if (flags and $100)=$100 then
-    oflags:=oflags or (O_APPEND);
-{ empty name is special }
-  if p[0]=#0 then
-   begin
-     case FileRec(f).mode of
-       fminput :
-         FileRec(f).Handle:=StdInputHandle;
-       fminout, { this is set by rewrite }
-       fmoutput :
-         FileRec(f).Handle:=StdOutputHandle;
-       fmappend :
-         begin
-           FileRec(f).Handle:=StdOutputHandle;
-           FileRec(f).mode:=fmoutput; {fool fmappend}
-         end;
-     end;
-     exit;
-   end;
-{ real open call }
-  FileRec(f).Handle:=Fpopen(p,oflags,MODE_OPEN);
-  if (FileRec(f).Handle<0) and
-     (getErrNo=ESysEROFS) and
-     ((OFlags and O_RDWR)<>0) then
-   begin
-     Oflags:=Oflags and not(O_RDWR);
-     FileRec(f).Handle:=Fpopen(p,oflags,MODE_OPEN);
-   end;
-  If Filerec(f).Handle<0 Then
-   InOutRes := 2
-  else
-   InOutRes:=0;
-end;
-*)
-{function do_isdevice(handle:longint):boolean;
-begin
-  do_isdevice:=false;
-  InOutRes:=0;
-end;
-}
-
 { $I text.inc}
 
 {*****************************************************************************
@@ -554,16 +284,52 @@ Begin
   randseed:=longint(Fptime(nil));
 End;
 
-function GetProcessID:SizeUInt;
+function GetProcessID: SizeUInt;
 begin
-{$WARNING To be corrected by platform maintainer}
- GetProcessID := 1;
+  GetProcessID := SizeUInt (fpGetPID);
 end;
 
 {*****************************************************************************
                          SystemUnit Initialization
 *****************************************************************************}
 
+function  reenable_signal(sig : longint) : boolean;
+var
+  e : TSigSet;
+  i,j : byte;
+begin
+  fillchar(e,sizeof(e),#0);
+  { set is 1 based PM }
+  dec(sig);
+  i:=sig mod (sizeof(cuLong) * 8);
+  j:=sig div (sizeof(cuLong) * 8);
+  e[j]:=1 shl i;
+  fpsigprocmask(SIG_UNBLOCK,@e,nil);
+  reenable_signal:=geterrno=0;
+end;
+
+// signal handler is arch dependant due to processorexception to language
+// exception translation
+
+{$i sighnd.inc}
+
+var
+  act: SigActionRec;
+
+Procedure InstallSignals;
+begin
+  { Initialize the sigaction structure }
+  { all flags and information set to zero }
+  FillChar(act, sizeof(SigActionRec),0);
+  { initialize handler                    }
+  act.sa_handler := SigActionHandler(@SignalToRunError);
+  act.sa_flags:=SA_SIGINFO;
+  FpSigAction(SIGFPE,@act,nil);
+  FpSigAction(SIGSEGV,@act,nil);
+  FpSigAction(SIGBUS,@act,nil);
+  FpSigAction(SIGILL,@act,nil);
+end;
+
 procedure SysInitStdIO;
 begin
   { Setup stdin, stdout and stderr, for GUI apps redirect stderr,stdout to be
@@ -582,10 +348,15 @@ end;
 var
   s : string;
 begin
+  SysResetFPU;
   IsConsole := TRUE;
   IsLibrary := FALSE;
   StackLength := CheckInitialStkLen(InitialStkLen);
   StackBottom := Sptr - StackLength;
+
+  { Set up signals handlers }
+  InstallSignals;
+
   SysInitStdIO;
 { Setup heap }
   myheapsize:=4096*1;// $ 20000;
@@ -641,5 +412,6 @@ begin
 {$ifdef HASVARIANT}
   initvariantmanager;
 {$endif HASVARIANT}
+  initwidestringmanager;
   setupexecname;
 end.

+ 0 - 163
rtl/beos/unxsysc.inc

@@ -1,163 +0,0 @@
-{
-   This file is part of the Free Pascal run time library.
-   Copyright (c) 2003 Marco van de Voort
-   member of the Free Pascal development team.
-
-   See the file COPYING.FPC, included in this distribution,
-   for details about the copyright.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY;without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-**********************************************************************}
-
-function fpNice(N:cint):cint;
-{
-  Set process priority. A positive N means a lower priority.
-  A negative N decreases priority.
-
-Doesn't exist in BSD. Linux emu uses setpriority in a construct as below:
-}
-
-begin
-  fpNice:=fpSetPriority(Prio_Process,0,N);
-end;
-
-
-Function fpGetPriority(Which,Who:cint):cint;
-{
-  Get Priority of process, process group, or user.
-   Which : selects what kind of priority is used.
-           can be one of the following predefined Constants :
-              Prio_User.
-              Prio_PGrp.
-              Prio_Process.
-   Who : depending on which, this is , respectively :
-              Uid
-              Pid
-              Process Group id
-   Errors are reported in linuxerror _only_. (priority can be negative)
-}
-begin
-  if (which<prio_process) or (which>prio_user) then
-   begin
-     { We can save an interrupt here }
-     fpgetpriority:=0;
-     fpseterrno(ESysEinval);
-   end
-  else
-   begin
-    {$warning TODO BeOS fpGetPriority implementation}      
-//     fpGetPriority:=do_syscall(syscall_nr_GetPriority,which,who);
-   end;
-end;
-
-
-Function fpSetPriority(Which,Who,What:cint):cint;
-{
- Set Priority of process, process group, or user.
-   Which : selects what kind of priority is used.
-           can be one of the following predefined Constants :
-              Prio_User.
-              Prio_PGrp.
-              Prio_Process.
-   Who : depending on value of which, this is, respectively :
-              Uid
-              Pid
-              Process Group id
-   what : A number between -20 and 20. -20 is most favorable, 20 least.
-          0 is the default.
-}
-begin
-  if ((which<prio_process) or (which>prio_user)) or ((what<-20) or (what>20)) then
-   fpseterrno(ESyseinval)  { We can save an interrupt here }
-  else
-   begin
-    {$warning TODO BeOS fpSetPriority implementation}   
-//     fpSetPriority:=do_syscall(Syscall_nr_Setpriority,which,who,what);
-   end;
-end;
-
-Function fpLstat(path:pchar;Info:pstat):cint;
-{
-  Get all information on a link (the link itself), and return it in info.
-}
-
-begin
-  {$warning TODO BeOS fpLstat implementation}
-// fpLStat:=do_syscall(syscall_nr_lstat,TSysParam(path),TSysParam(info));
-end;
-
-
-Function fpLstat(Filename: PathStr;Info:pstat):cint;
-{
-  Get all information on a link (the link itself), and return it in info.
-}
-
-begin
-  {$warning TODO BeOS fpLstat implementation}
- FileName:=FileName+#0;
-// fpLStat:=do_syscall(syscall_nr_lstat,TSysParam(@filename[1]),TSysParam(info));
-end;
-
-Function fpSymlink(oldname,newname:pchar):cint;
-{
-  We need this for erase
-}
-
-begin
-  {$warning TODO BeOS fpSymlink implementation}
-// fpsymlink:=do_syscall(syscall_nr_symlink,TSysParam(oldname),TSysParam(newname));
-end;
-
-Function fpReadLink(name,linkname:pchar;maxlen:cint):cint;
-
-begin
-  {$warning TODO BeOS fsync implementation}
-//  fpreadlink:=do_syscall(syscall_nr_readlink, TSysParam(name),TSysParam(linkname),maxlen);
-end;
-
-{$ifndef FPC_USE_LIBC}
-Function  fsync (fd : cint) : cint;
-
-begin
-  {$warning TODO BeOS fsync implementation}
-//  fsync:=do_syscall(syscall_nr_fsync,fd);
-end;
-
-
-
-Function  fpFlock (fd,mode : longint) : cint;
-
-begin
-  {$warning TODO BeOS fpFlock implementation}
-// Flock:=do_syscall(syscall_nr_flock,fd,mode);
-end;
-
-
-Function fStatFS(Fd:Longint;Var Info:tstatfs):cint;
-{
-  Get all information on a fileSystem, and return it in Info.
-  Fd is the file descriptor of a file/directory on the fileSystem
-  you wish to investigate.
-}
-
-begin
-  {$warning TODO BeOS fStatFS implementation}
-// fStatFS:=do_syscall(syscall_nr_fstatfs,fd,longint(@info));
-end;
-
-Function StatFS(path:pchar;Var Info:tstatfs):cint;
-{
-  Get all information on a fileSystem, and return it in Info.
-  Fd is the file descriptor of a file/directory on the fileSystem
-  you wish to investigate.
-}
-
-begin
-  {$warning TODO BeOS StatFS implementation}
-// StatFS:=do_syscall(syscall_nr_statfs,longint(path),longint(@info));
-end;
-
-{$endif}

+ 0 - 24
rtl/beos/unxsysch.inc

@@ -1,24 +0,0 @@
-{
-   This file is part of the Free Pascal run time library.
-   Copyright (c) 2003 Marco van de Voort
-   member of the Free Pascal development team.
-
-   See the file COPYING.FPC, included in this distribution,
-   for details about the copyright.
-
-   This program is distributed in the hope that it will be useful,
-   but WITHOUT ANY WARRANTY;without even the implied warranty of
-   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
-
-**********************************************************************}
-
-function fpNice(N:cint):cint;
-Function fpGetPriority(Which,Who:cint):cint;
-Function fpSetPriority(Which,Who,What:cint):cint;
-Function fpLstat(path:pchar;Info:pstat):cint;
-Function fpLstat(Filename: PathStr;Info:pstat):cint;
-Function fpSymlink(oldname,newname:pchar):cint;
-Function fpReadLink(name,linkname:pchar;maxlen:cint):cint;
-Function Fpmmap(start:pointer;len:size_t;prot:cint;flags:cint;fd:cint;offst:off_t):pointer; external name  'FPC_SYSC_MMAP';
-Function Fpmunmap(start:pointer;len:size_t):cint;  external name 'FPC_SYSC_MUNMAP';
-function fpgettimeofday(tp: ptimeval;tzp:ptimezone):cint; external name 'FPC_SYSC_GETTIMEOFDAY';

+ 2 - 0
rtl/inc/cmem.pp

@@ -31,6 +31,8 @@ Const
   LibName = 'libc';
 {$elseif defined(macos)}
   LibName = 'StdCLib';
+{$elseif defined(beos)}
+  LibName = 'root';
 {$else}
   LibName = 'c';
 {$endif}

+ 1 - 1
rtl/inc/lineinfo.pp

@@ -814,7 +814,7 @@ end;
 
 {$ifdef beos}
 
-{$i osposixh.inc}
+{$i ptypes.inc}
 
 { ------------------------- Images --------------------------- }
 

+ 19 - 2
rtl/unix/cwstring.pp

@@ -73,9 +73,16 @@ const
 {$ifdef solaris}
   CODESET=49;
   LC_ALL = 6;
+{$else solaris}
+{$ifdef beos}
+  {$warning check correct value for BeOS}
+  CODESET=49;
+  LC_ALL = 6; // Checked for BeOS, but 0 under Haiku...
+  ESysEILSEQ = EILSEQ;
 {$else}
 {$error lookup the value of CODESET in /usr/include/langinfo.h, and the value of LC_ALL in /usr/include/locale.h for your OS }
 // and while doing it, check if iconv is in libc, and if the symbols are prefixed with iconv_ or libiconv_
+{$endif beos}
 {$endif solaris}
 {$endif FreeBSD}
 {$endif darwin}
@@ -94,9 +101,11 @@ type
   piconv_t = ^iconv_t;
   iconv_t = pointer;
   nl_item = cint;
-
+{$ifndef beos}
 function nl_langinfo(__item:nl_item):pchar;cdecl;external libiconvname name 'nl_langinfo';
-{$ifndef bsd}
+{$endif}
+{ $ ifndef bsd}
+{$if not defined(bsd) and not defined(beos)}
 function iconv_open(__tocode:pchar; __fromcode:pchar):iconv_t;cdecl;external libiconvname name 'iconv_open';
 function iconv(__cd:iconv_t; __inbuf:ppchar; __inbytesleft:psize_t; __outbuf:ppchar; __outbytesleft:psize_t):size_t;cdecl;external libiconvname name 'iconv';
 function iconv_close(__cd:iconv_t):cint;cdecl;external libiconvname name 'iconv_close';
@@ -112,6 +121,14 @@ threadvar
   iconv_ansi2wide,
   iconv_wide2ansi : iconv_t;
  
+{$ifdef beos}
+function nl_langinfo(__item:nl_item):pchar;
+begin
+  {$warning TODO BeOS nl_langinfo or more uptodate port of iconv...}  
+  Result := '';
+end;
+{$endif}
+
 procedure Wide2AnsiMove(source:pwidechar;var dest:ansistring;len:SizeInt);
   var
     outlength,

+ 6 - 2
rtl/unix/unxdeclh.inc

@@ -23,12 +23,16 @@ Function fpFlock (fd,mode : longint) : cint; cdecl; external clib name 'flock';
 {$endif beos}
 {$endif solaris}
 
-{$ifndef beos}
+{$ifdef beos}
+Function fStatFS(Fd:Longint;Var Info:tstatfs):cint; cdecl; external clib name 'fstatvfs';
+{$else beos}
 Function fStatFS(Fd:Longint;Var Info:tstatfs):cint; cdecl; external clib name 'fstatfs';
 {$endif beos}
 
 Function fsync (fd : cint) : cint; cdecl; external clib name 'fsync';
-{$ifndef beos}
+{$ifdef beos}
+Function StatFS  (Path:pchar;Var Info:tstatfs):cint; cdecl; external clib name 'statvfs';
+{$else beos}
 Function StatFS  (Path:pchar;Var Info:tstatfs):cint; cdecl; external clib name 'statfs';
 {$endif beos}
 function pipe (var fildes: filedesarray):cint;  cdecl; external clib name 'pipe';