浏览代码

Merged revisions 9358,9715,9797,9869,9871,9887,10231,10248-10249,10260,10270,10275,10325,10362-10363,10368,10375,10386 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r9358 | jonas | 2007-11-30 18:57:39 +0100 (Fri, 30 Nov 2007) | 2 lines

* variants depends on math

........
r9715 | jonas | 2008-01-11 21:08:47 +0100 (Fri, 11 Jan 2008) | 8 lines

* compare stripped copies of the compiler instead of the original
compiler binaries when determining whether cycle has finished
on darwin, because when using Dwarf the linked binaries are
always slightly different there (because the Dwarf info is kept
in the object files and is referenced using a unique identifier,
to be able to ascertain that you are using the correct object
files and binary together when debugging)

........
r9797 | jonas | 2008-01-19 21:44:43 +0100 (Sat, 19 Jan 2008) | 2 lines

* fix from r9332 for shared libraries

........
r9869 | jonas | 2008-01-22 20:41:20 +0100 (Tue, 22 Jan 2008) | 2 lines

* added more compiler names to svn:ignore settings

........
r9871 | jonas | 2008-01-22 22:27:34 +0100 (Tue, 22 Jan 2008) | 3 lines

* fixed assignments to integer regvars typecasted to a type
of equal size but with different signdness + test

........
r9887 | jonas | 2008-01-23 23:28:12 +0100 (Wed, 23 Jan 2008) | 2 lines

* fixed include/exclude for byte-sized sets in registers

........
r10231 | jonas | 2008-02-05 17:07:18 +0100 (Tue, 05 Feb 2008) | 10 lines

* synchronised with r210 of the common pascal interfaces

...
r210 | jonas | 2008-02-05 17:01:30 +0100 (Tue, 05 Feb 2008) | 2 lines
Changed paths:
M /metaPascal/trunc/MPPInterfaces/CFByteOrders.pas

* fixed CFConvert*SwappedTo* for FPC
...

........
r10248 | jonas | 2008-02-08 15:06:31 +0100 (Fri, 08 Feb 2008) | 2 lines

* fixed FindSectionMachO32PPC() return value

........
r10249 | jonas | 2008-02-08 16:04:58 +0100 (Fri, 08 Feb 2008) | 3 lines

* call FreeInstance after fail if vmt<>nil rather than if vmt=1
(mantis #10790)

........
r10260 | jonas | 2008-02-10 11:07:55 +0100 (Sun, 10 Feb 2008) | 2 lines

* added missing begin/end

........
r10270 | jonas | 2008-02-10 15:42:49 +0100 (Sun, 10 Feb 2008) | 6 lines

* always use ppc<targetcpu> instead of ppcross<targetcpu> on darwin,
because due to the mach-o executable format which can contain
binaries for different architectures in a single file, different
names for native and cross compilers are not used on Mac OS X
(mantis #10067)

........
r10275 | jonas | 2008-02-10 18:05:27 +0100 (Sun, 10 Feb 2008) | 2 lines

- removed {$ifndef cpu64bit} code

........
r10325 | jonas | 2008-02-14 17:17:33 +0100 (Thu, 14 Feb 2008) | 2 lines

+ test for proper freeing of thread resources

........
r10362 | jonas | 2008-02-19 21:20:26 +0100 (Tue, 19 Feb 2008) | 3 lines

* fixed skipping of character after number of errors to report in
parsing of -Se<xxx> string (mantis #10849)

........
r10363 | jonas | 2008-02-19 21:24:22 +0100 (Tue, 19 Feb 2008) | 2 lines

+ test for previous commit

........
r10368 | jonas | 2008-02-20 12:50:12 +0100 (Wed, 20 Feb 2008) | 2 lines

* rlwnm_ -> rlwnm.

........
r10375 | jonas | 2008-02-21 14:18:56 +0100 (Thu, 21 Feb 2008) | 3 lines

* replaced a trunc() with an int() call (because its result is compared
with a float as well)

........
r10386 | jonas | 2008-02-25 16:40:13 +0100 (Mon, 25 Feb 2008) | 7 lines

* lineinfo and lnfodwrf depend on inc/exeinfo.pp
+ add fake dependency of lnfodwrf on lineinfo to avoid those two
units being compiled together, because then inc/exeinfo.pp can
also be compiled twice at the same time which leads to trouble
if -ap isn't used
(part of r10329, forgot to commit)

........

git-svn-id: branches/fixes_2_2@10391 -

Jonas Maebe 17 年之前
父节点
当前提交
dbe420358e

+ 4 - 0
.gitattributes

@@ -6323,6 +6323,7 @@ tests/tbs/tb0168.pp svneol=native#text/plain
 tests/tbs/tb0169.pp svneol=native#text/plain
 tests/tbs/tb0169.pp svneol=native#text/plain
 tests/tbs/tb0170.pp svneol=native#text/plain
 tests/tbs/tb0170.pp svneol=native#text/plain
 tests/tbs/tb0172.pp svneol=native#text/plain
 tests/tbs/tb0172.pp svneol=native#text/plain
+tests/tbs/tb0172a.pp svneol=native#text/plain
 tests/tbs/tb0173.pp svneol=native#text/plain
 tests/tbs/tb0173.pp svneol=native#text/plain
 tests/tbs/tb0174.pp svneol=native#text/plain
 tests/tbs/tb0174.pp svneol=native#text/plain
 tests/tbs/tb0175.pp svneol=native#text/plain
 tests/tbs/tb0175.pp svneol=native#text/plain
@@ -7555,6 +7556,7 @@ tests/webtbf/tw0896.pp svneol=native#text/plain
 tests/webtbf/tw0896a.pp svneol=native#text/plain
 tests/webtbf/tw0896a.pp svneol=native#text/plain
 tests/webtbf/tw10425a.pp svneol=native#text/plain
 tests/webtbf/tw10425a.pp svneol=native#text/plain
 tests/webtbf/tw10457.pp svneol=native#text/plain
 tests/webtbf/tw10457.pp svneol=native#text/plain
+tests/webtbf/tw10849.pp svneol=native#text/plain
 tests/webtbf/tw1157a.pp svneol=native#text/plain
 tests/webtbf/tw1157a.pp svneol=native#text/plain
 tests/webtbf/tw1238.pp svneol=native#text/plain
 tests/webtbf/tw1238.pp svneol=native#text/plain
 tests/webtbf/tw1251a.pp svneol=native#text/plain
 tests/webtbf/tw1251a.pp svneol=native#text/plain
@@ -7891,8 +7893,10 @@ tests/webtbs/tw10681.pp svneol=native#text/plain
 tests/webtbs/tw1071.pp svneol=native#text/plain
 tests/webtbs/tw1071.pp svneol=native#text/plain
 tests/webtbs/tw1073.pp svneol=native#text/plain
 tests/webtbs/tw1073.pp svneol=native#text/plain
 tests/webtbs/tw10757.pp svneol=native#text/plain
 tests/webtbs/tw10757.pp svneol=native#text/plain
+tests/webtbs/tw10790.pp svneol=native#text/plain
 tests/webtbs/tw10800.pp svneol=native#text/plain
 tests/webtbs/tw10800.pp svneol=native#text/plain
 tests/webtbs/tw1081.pp svneol=native#text/plain
 tests/webtbs/tw1081.pp svneol=native#text/plain
+tests/webtbs/tw10815.pp svneol=native#text/plain
 tests/webtbs/tw1090.pp svneol=native#text/plain
 tests/webtbs/tw1090.pp svneol=native#text/plain
 tests/webtbs/tw1092.pp svneol=native#text/plain
 tests/webtbs/tw1092.pp svneol=native#text/plain
 tests/webtbs/tw1096.pp svneol=native#text/plain
 tests/webtbs/tw1096.pp svneol=native#text/plain

+ 17 - 0
.gitignore

@@ -89,10 +89,27 @@ compiler/powerpc/fpcmade.*
 compiler/powerpc/units
 compiler/powerpc/units
 compiler/powerpc64/units
 compiler/powerpc64/units
 compiler/ppc1
 compiler/ppc1
+compiler/ppc1.exe
 compiler/ppc2
 compiler/ppc2
+compiler/ppc2.exe
 compiler/ppc3
 compiler/ppc3
+compiler/ppc3.exe
 compiler/ppc386
 compiler/ppc386
+compiler/ppc386.exe
+compiler/ppc68k
+compiler/ppc68k.exe
+compiler/ppcarm
+compiler/ppcarm.exe
+compiler/ppcppc
+compiler/ppcppc.exe
+compiler/ppcppc64
+compiler/ppcppc64.exe
 compiler/ppcrossx64
 compiler/ppcrossx64
+compiler/ppcrossx64.exe
+compiler/ppcsparc
+compiler/ppcsparc.exe
+compiler/ppcx64
+compiler/ppcx64.exe
 compiler/sparc/*.bak
 compiler/sparc/*.bak
 compiler/sparc/*.exe
 compiler/sparc/*.exe
 compiler/sparc/*.o
 compiler/sparc/*.o

+ 73 - 3
compiler/Makefile

@@ -1,11 +1,12 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/09/01]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/01/24]
 #
 #
 default: all
 default: all
-MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-embedded
+MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
 BSDs = freebsd netbsd openbsd darwin
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
 LIMIT83fs = go32v2 os2 emx watcom
+OSNeedsComspecToRunBatch = go32v2 watcom
 FORCE:
 FORCE:
 .PHONY: FORCE
 .PHONY: FORCE
 override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
 override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
@@ -56,6 +57,11 @@ else
 SRCBATCHEXT=.bat
 SRCBATCHEXT=.bat
 endif
 endif
 endif
 endif
+ifdef COMSPEC
+ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
+RUNBATCH=$(COMSPEC) /C
+endif
+endif
 ifdef inUnix
 ifdef inUnix
 PATHSEP=/
 PATHSEP=/
 else
 else
@@ -102,7 +108,11 @@ ifndef FPC
 FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
 FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(FPCPROG),)
 ifneq ($(FPCPROG),)
 FPCPROG:=$(firstword $(FPCPROG))
 FPCPROG:=$(firstword $(FPCPROG))
+ifneq ($(CPU_TARGET),)
+FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB)
+else
 FPC:=$(shell $(FPCPROG) -PB)
 FPC:=$(shell $(FPCPROG) -PB)
+endif
 ifneq ($(findstring Error,$(FPC)),)
 ifneq ($(findstring Error,$(FPC)),)
 override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
 override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
 endif
 endif
@@ -472,6 +482,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_DIRS+=utils
 override TARGET_DIRS+=utils
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override TARGET_DIRS+=utils
+endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 ifeq ($(FULL_TARGET),x86_64-win64)
 override TARGET_DIRS+=utils
 override TARGET_DIRS+=utils
 endif
 endif
@@ -502,6 +515,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override TARGET_DIRS+=utils
 override TARGET_DIRS+=utils
 endif
 endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_DIRS+=utils
+endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 override TARGET_DIRS+=utils
 override TARGET_DIRS+=utils
 endif
 endif
@@ -625,6 +641,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_PROGRAMS+=pp
 override TARGET_PROGRAMS+=pp
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override TARGET_PROGRAMS+=pp
+endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 ifeq ($(FULL_TARGET),x86_64-win64)
 override TARGET_PROGRAMS+=pp
 override TARGET_PROGRAMS+=pp
 endif
 endif
@@ -655,6 +674,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override TARGET_PROGRAMS+=pp
 override TARGET_PROGRAMS+=pp
 endif
 endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override TARGET_PROGRAMS+=pp
+endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 override TARGET_PROGRAMS+=pp
 override TARGET_PROGRAMS+=pp
 endif
 endif
@@ -779,6 +801,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_INCLUDEDIR+=$(PPC_TARGET)
 override COMPILER_INCLUDEDIR+=$(PPC_TARGET)
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_INCLUDEDIR+=$(PPC_TARGET)
+endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 ifeq ($(FULL_TARGET),x86_64-win64)
 override COMPILER_INCLUDEDIR+=$(PPC_TARGET)
 override COMPILER_INCLUDEDIR+=$(PPC_TARGET)
 endif
 endif
@@ -809,6 +834,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override COMPILER_INCLUDEDIR+=$(PPC_TARGET)
 override COMPILER_INCLUDEDIR+=$(PPC_TARGET)
 endif
 endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_INCLUDEDIR+=$(PPC_TARGET)
+endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 override COMPILER_INCLUDEDIR+=$(PPC_TARGET)
 override COMPILER_INCLUDEDIR+=$(PPC_TARGET)
 endif
 endif
@@ -932,6 +960,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
 override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
+endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 ifeq ($(FULL_TARGET),x86_64-win64)
 override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
 override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
 endif
 endif
@@ -962,6 +993,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
 override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
 endif
 endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
+endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
 override COMPILER_UNITDIR+=$(COMPILERSOURCEDIR)
 endif
 endif
@@ -1085,6 +1119,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_TARGETDIR+=.
 override COMPILER_TARGETDIR+=.
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_TARGETDIR+=.
+endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 ifeq ($(FULL_TARGET),x86_64-win64)
 override COMPILER_TARGETDIR+=.
 override COMPILER_TARGETDIR+=.
 endif
 endif
@@ -1115,6 +1152,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override COMPILER_TARGETDIR+=.
 override COMPILER_TARGETDIR+=.
 endif
 endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_TARGETDIR+=.
+endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 override COMPILER_TARGETDIR+=.
 override COMPILER_TARGETDIR+=.
 endif
 endif
@@ -1238,6 +1278,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
 override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
+endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 ifeq ($(FULL_TARGET),x86_64-win64)
 override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
 override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
 endif
 endif
@@ -1268,6 +1311,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
 override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
 override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
 endif
 endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
+endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
 override COMPILER_UNITTARGETDIR+=$(CPU_UNITDIR)/units/$(FULL_TARGET)
 endif
 endif
@@ -2139,6 +2185,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 ifeq ($(FULL_TARGET),x86_64-win64)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -2169,6 +2218,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 REQUIRE_PACKAGES_RTL=1
 REQUIRE_PACKAGES_RTL=1
 endif
 endif
@@ -2212,7 +2264,7 @@ override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
 endif
 endif
 ifndef CROSSBOOTSTRAP
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
-override FPCOPT+=-XP$(BINUTILSPREFIX) 
+override FPCOPT+=-XP$(BINUTILSPREFIX)
 endif
 endif
 ifneq ($(BINUTILSPREFIX),)
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-Xr$(RLINKPATH)
 override FPCOPT+=-Xr$(RLINKPATH)
@@ -2344,9 +2396,13 @@ ifeq (,$(findstring -s ,$(COMPILER)))
 EXECPPAS=
 EXECPPAS=
 else
 else
 ifeq ($(FULL_SOURCE),$(FULL_TARGET))
 ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+ifdef RUNBATCH
+EXECPPAS:=@$(RUNBATCH) $(PPAS)
+else
 EXECPPAS:=@$(PPAS)
 EXECPPAS:=@$(PPAS)
 endif
 endif
 endif
 endif
+endif
 .PHONY: fpc_exes
 .PHONY: fpc_exes
 ifndef CROSSINSTALL
 ifndef CROSSINSTALL
 ifneq ($(TARGET_PROGRAMS),)
 ifneq ($(TARGET_PROGRAMS),)
@@ -2578,8 +2634,12 @@ else
 endif
 endif
 ifdef inUnix
 ifdef inUnix
 	/bin/sh $(ZIPWRAPPER)
 	/bin/sh $(ZIPWRAPPER)
+else
+ifdef RUNBATCH
+	$(RUNBATCH) (ZIPWRAPPER)
 else
 else
 	$(ZIPWRAPPER)
 	$(ZIPWRAPPER)
+endif
 endif
 endif
 	$(DEL) $(ZIPWRAPPER)
 	$(DEL) $(ZIPWRAPPER)
 else
 else
@@ -2887,6 +2947,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 TARGET_DIRS_UTILS=1
 TARGET_DIRS_UTILS=1
 endif
 endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+TARGET_DIRS_UTILS=1
+endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 ifeq ($(FULL_TARGET),x86_64-win64)
 TARGET_DIRS_UTILS=1
 TARGET_DIRS_UTILS=1
 endif
 endif
@@ -2917,6 +2980,9 @@ endif
 ifeq ($(FULL_TARGET),powerpc64-linux)
 ifeq ($(FULL_TARGET),powerpc64-linux)
 TARGET_DIRS_UTILS=1
 TARGET_DIRS_UTILS=1
 endif
 endif
+ifeq ($(FULL_TARGET),powerpc64-darwin)
+TARGET_DIRS_UTILS=1
+endif
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 ifeq ($(FULL_TARGET),powerpc64-embedded)
 TARGET_DIRS_UTILS=1
 TARGET_DIRS_UTILS=1
 endif
 endif
@@ -3105,8 +3171,12 @@ ifeq ($(CPU_SOURCE),$(PPC_TARGET))
 ifeq ($(OS_SOURCE),$(OS_TARGET))
 ifeq ($(OS_SOURCE),$(OS_TARGET))
 ifdef DIFF
 ifdef DIFF
 ifdef OLDFPC
 ifdef OLDFPC
+ifneq ($(OS_TARGET),darwin)
 DIFFRESULT:=$(shell $(DIFF) $(OLDFPC) $(FPC))
 DIFFRESULT:=$(shell $(DIFF) $(OLDFPC) $(FPC))
 else
 else
+DIFFRESULT:=$(shell cp $(OLDFPC) $(OLDFPC).tmp; cp $(FPC) $(FPC).tmp; strip -no_uuid $(OLDFPC).tmp; strip -no_uuid $(FPC).tmp; $(DIFF) $(OLDFPC).tmp $(FPC).tmp; rm $(OLDFPC).tmp $(FPC).tmp)
+endif
+else
 DIFFRESULT=Not equal
 DIFFRESULT=Not equal
 endif
 endif
 else
 else

+ 4 - 0
compiler/Makefile.fpc

@@ -401,8 +401,12 @@ ifeq ($(OS_SOURCE),$(OS_TARGET))
 # Used to avoid unnecessary steps
 # Used to avoid unnecessary steps
 ifdef DIFF
 ifdef DIFF
 ifdef OLDFPC
 ifdef OLDFPC
+ifneq ($(OS_TARGET),darwin)
 DIFFRESULT:=$(shell $(DIFF) $(OLDFPC) $(FPC))
 DIFFRESULT:=$(shell $(DIFF) $(OLDFPC) $(FPC))
 else
 else
+DIFFRESULT:=$(shell cp $(OLDFPC) $(OLDFPC).tmp; cp $(FPC) $(FPC).tmp; strip -no_uuid $(OLDFPC).tmp; strip -no_uuid $(FPC).tmp; $(DIFF) $(OLDFPC).tmp $(FPC).tmp; rm $(OLDFPC).tmp $(FPC).tmp)
+endif
+else
 DIFFRESULT=Not equal
 DIFFRESULT=Not equal
 endif
 endif
 else
 else

+ 11 - 0
compiler/htypechk.pas

@@ -1099,6 +1099,17 @@ implementation
                       if report_errors then
                       if report_errors then
                         CGMessagePos2(hp.fileinfo,type_e_typecast_wrong_size_for_assignment,tostr(fromdef.size),tostr(todef.size));
                         CGMessagePos2(hp.fileinfo,type_e_typecast_wrong_size_for_assignment,tostr(fromdef.size),tostr(todef.size));
                   end;
                   end;
+                  
+                 { when typecasting to the same size but changing the signdness of
+                   an ordinal, the value cannot be in a register if it's < sizeof(aint).
+                   The reason is that a tc_int_2_int type conversion changing the sign
+                   of a such value in a register also has to modify this register (JM)   }
+                 if is_ordinal(fromdef) and is_ordinal(todef) and
+                    (fromdef.size=todef.size) and
+                    (fromdef.size<sizeof(aint)) and
+                    (is_signed(fromdef) xor is_signed(todef)) then
+                   make_not_regable(hp,[ra_addr_regable]);
+
                  { don't allow assignments to typeconvs that need special code }
                  { don't allow assignments to typeconvs that need special code }
                  if not(gotsubscript or gotvec or gotderef) and
                  if not(gotsubscript or gotvec or gotderef) and
                     not(ttypeconvnode(hp).assign_allowed) then
                     not(ttypeconvnode(hp).assign_allowed) then

+ 9 - 7
compiler/i386/csopt386.pas

@@ -193,13 +193,15 @@ begin
               tmpRef.base := NR_EDI;
               tmpRef.base := NR_EDI;
               tmpRef.index := NR_EDI;
               tmpRef.index := NR_EDI;
               for regCounter := RS_EAX to RS_EDI do
               for regCounter := RS_EAX to RS_EDI do
-                if writeToMemDestroysContents(RS_INVALID,tmpRef,regCounter,OS_32,c[regCounter],dummy) then
-                  begin
-                    exclude(regsStillValid,regCounter);
-                    modifiesConflictingMemLocation := not(supreg in regsStillValid);
-                 end;
-              if (regcounter = supreg) then
-                invalsmemwrite := invalsmemwrite or dummy;
+                begin
+                  if writeToMemDestroysContents(RS_INVALID,tmpRef,regCounter,OS_32,c[regCounter],dummy) then
+                    begin
+                      exclude(regsStillValid,regCounter);
+                      modifiesConflictingMemLocation := not(supreg in regsStillValid);
+                   end;
+                  if (regcounter = supreg) then
+                    invalsmemwrite := invalsmemwrite or dummy;
+                end;
             end;
             end;
         end;
         end;
   end;
   end;

+ 4 - 6
compiler/nutils.pas

@@ -453,17 +453,15 @@ implementation
             if assigned(srsym) and
             if assigned(srsym) and
                (srsym.typ=procsym) then
                (srsym.typ=procsym) then
               begin
               begin
-                { if self<>0 and vmt=1 then freeinstance }
+                { if self<>0 and vmt<>0 then freeinstance }
                 addstatement(newstatement,cifnode.create(
                 addstatement(newstatement,cifnode.create(
                     caddnode.create(andn,
                     caddnode.create(andn,
                         caddnode.create(unequaln,
                         caddnode.create(unequaln,
                             load_self_pointer_node,
                             load_self_pointer_node,
                             cnilnode.create),
                             cnilnode.create),
-                        caddnode.create(equaln,
-                            ctypeconvnode.create(
-                                load_vmt_pointer_node,
-                                voidpointertype),
-                            cpointerconstnode.create(1,voidpointertype))),
+                        caddnode.create(unequaln,
+                            load_vmt_pointer_node,
+                            cnilnode.create)),
                     ccallnode.create(nil,tprocsym(srsym),srsym.owner,load_self_node,[]),
                     ccallnode.create(nil,tprocsym(srsym),srsym.owner,load_self_node,[]),
                     nil));
                     nil));
               end
               end

+ 1 - 1
compiler/powerpc/itcpugas.pas

@@ -57,7 +57,7 @@ interface
         'mulhw.','mulhwu','mulhwu.','mulli','mullw','mullw.','mullwo',
         'mulhw.','mulhwu','mulhwu.','mulli','mullw','mullw.','mullwo',
         'mullwo.','nand','nand.','neg','neg.','nego','nego.','nor','nor.',
         'mullwo.','nand','nand.','neg','neg.','nego','nego.','nor','nor.',
         'or','or.','orc','orc.','ori','oris', 'rfi', 'rlwimi', 'rlwimi.',
         'or','or.','orc','orc.','ori','oris', 'rfi', 'rlwimi', 'rlwimi.',
-        'rlwinm', 'rlwinm.','rlwnm','rlwnm_','sc','slw', 'slw.', 'sraw', 'sraw.',
+        'rlwinm', 'rlwinm.','rlwnm','rlwnm.','sc','slw', 'slw.', 'sraw', 'sraw.',
         'srawi', 'srawi.','srw', 'srw.', 'stb', 'stbu', 'stbux','stbx','stfd',
         'srawi', 'srawi.','srw', 'srw.', 'stb', 'stbu', 'stbux','stbx','stfd',
         'stfdu', 'stfdux', 'stfdx', 'stfiwx', 'stfs', 'stfsu', 'stfsux', 'stfsx',
         'stfdu', 'stfdux', 'stfdx', 'stfiwx', 'stfs', 'stfsu', 'stfsux', 'stfsx',
         'sth', 'sthbrx', 'sthu', 'sthux', 'sthx', 'stmw', 'stswi', 'stswx', 'stw',
         'sth', 'sthbrx', 'sthu', 'sthux', 'sthx', 'stmw', 'stswi', 'stswx', 'stw',

+ 5 - 2
compiler/systems/t_bsd.pas

@@ -750,8 +750,11 @@ begin
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
   if (success) and not(cs_link_nolink in current_settings.globalswitches) then
     begin
     begin
       DeleteFile(outputexedir+Info.ResName);
       DeleteFile(outputexedir+Info.ResName);
-//      DeleteFile(linkscript.fn);
-      linkscript.free
+      if LdSupportsNoResponseFile Then
+        begin
+          DeleteFile(linkscript.fn);
+          linkscript.free
+        end;
     end;     
     end;     
 
 
   MakeSharedLibrary:=success;   { otherwise a recursive call to link method }
   MakeSharedLibrary:=success;   { otherwise a recursive call to link method }

+ 9 - 0
compiler/utils/fpc.pp

@@ -214,7 +214,16 @@ program fpc;
                            else
                            else
                              error('Illegal processor type "'+processorstr+'"');
                              error('Illegal processor type "'+processorstr+'"');
 
 
+{$ifndef darwin}
                            ppcbin:='ppcross'+cpusuffix;
                            ppcbin:='ppcross'+cpusuffix;
+{$else not darwin}
+                           { the mach-o format supports "fat" binaries whereby }
+                           { a single executable contains machine code for     }
+                           { several architectures -> it is counter-intuitive  }
+                           { and non-standard to use different binary names    }
+                           { for cross-compilers vs. native compilers          }
+                           ppcbin:='ppc'+cpusuffix;
+{$endif not darwin}
                          end;
                          end;
                  end
                  end
               else if pos('-Xp',s)=1 then
               else if pos('-Xp',s)=1 then

+ 1 - 1
compiler/verbose.pas

@@ -435,7 +435,7 @@ implementation
                   if code<>0 then
                   if code<>0 then
                    l:=1;
                    l:=1;
                   status.maxerrorcount:=l;
                   status.maxerrorcount:=l;
-                  i:=j;
+                  i:=j-1;
                 end;
                 end;
               'w','W' :
               'w','W' :
                 status.errorwarning:=true;
                 status.errorwarning:=true;

+ 15 - 4
compiler/x86/nx86inl.pas

@@ -337,12 +337,14 @@ implementation
 
 
       procedure tx86inlinenode.second_IncludeExclude;
       procedure tx86inlinenode.second_IncludeExclude;
         var
         var
-         hregister : tregister;
+         hregister,
+         hregister2: tregister;
          setbase   : aint;
          setbase   : aint;
          bitsperop,l : longint;
          bitsperop,l : longint;
          cgop : topcg;
          cgop : topcg;
          asmop : tasmop;
          asmop : tasmop;
-         opsize : tcgsize;
+         opsize,
+         orgsize: tcgsize;
         begin
         begin
           if not(is_varset(tcallparanode(left).resultdef)) then
           if not(is_varset(tcallparanode(left).resultdef)) then
             opsize:=int_cgsize(tcallparanode(left).resultdef.size)
             opsize:=int_cgsize(tcallparanode(left).resultdef.size)
@@ -380,8 +382,11 @@ implementation
             end
             end
           else
           else
             begin
             begin
+              orgsize:=opsize;
               if opsize in [OS_8,OS_S8] then
               if opsize in [OS_8,OS_S8] then
-                opsize:=OS_32;
+                begin
+                  opsize:=OS_32;
+                end;
               { determine asm operator }
               { determine asm operator }
               if inlinenumber=in_include_x_y then
               if inlinenumber=in_include_x_y then
                  asmop:=A_BTS
                  asmop:=A_BTS
@@ -394,7 +399,13 @@ implementation
               if (tcallparanode(left).left.location.loc=LOC_REFERENCE) then
               if (tcallparanode(left).left.location.loc=LOC_REFERENCE) then
                 emit_reg_ref(asmop,tcgsize2opsize[opsize],hregister,tcallparanode(left).left.location.reference)
                 emit_reg_ref(asmop,tcgsize2opsize[opsize],hregister,tcallparanode(left).left.location.reference)
               else
               else
-                emit_reg_reg(asmop,tcgsize2opsize[opsize],hregister,tcallparanode(left).left.location.register);
+                begin
+                  { second argument can't be an 8 bit register either }
+                  hregister2:=tcallparanode(left).left.location.register;
+                  if (orgsize in [OS_8,OS_S8]) then
+                    hregister2:=cg.makeregsize(current_asmdata.CurrAsmList,hregister2,opsize);
+                  emit_reg_reg(asmop,tcgsize2opsize[opsize],hregister,hregister2);
+                end;
             end;
             end;
         end;
         end;
 
 

+ 0 - 3
compiler/x86_64/cgcpu.pas

@@ -229,7 +229,4 @@ unit cgcpu;
 
 
 begin
 begin
   cg:=tcgx86_64.create;
   cg:=tcgx86_64.create;
-{$ifndef cpu64bit}
-  cg64:=tcg64f64.create;
-{$endif cpu64bit}
 end.
 end.

+ 22 - 22
packages/univint/src/CFByteOrders.pas

@@ -3,7 +3,7 @@
 }
 }
 {   Pascal Translation:  Peter N Lewis, <[email protected]>, August 2005 }
 {   Pascal Translation:  Peter N Lewis, <[email protected]>, August 2005 }
 {   Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
 {   Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
-{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, April 2006 }
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, April 2006, February 2008 }
 {
 {
     Modified for use with Free Pascal
     Modified for use with Free Pascal
     Version 200
     Version 200
@@ -150,13 +150,13 @@ type
 	end;
 	end;
 
 
 function CFConvertFloat32HostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
 function CFConvertFloat32HostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
-function CFConvertFloat32SwappedToHost( arg: Float32 ): CFSwappedFloat32; inline;
+function CFConvertFloat32SwappedToHost( arg: CFSwappedFloat32 ): Float32; inline;
 function CFConvertFloat64HostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
 function CFConvertFloat64HostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
-function CFConvertFloat64SwappedToHost( arg: Float64 ): CFSwappedFloat64; inline;
+function CFConvertFloat64SwappedToHost( arg: CFSwappedFloat64 ): Float64; inline;
 function CFConvertFloatHostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
 function CFConvertFloatHostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
-function CFConvertFloatSwappedToHost( arg: Float32 ): CFSwappedFloat32; inline;
+function CFConvertFloatSwappedToHost( arg: CFSwappedFloat32 ): Float32; inline;
 function CFConvertDoubleHostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
 function CFConvertDoubleHostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
-function CFConvertDoubleSwappedToHost( arg: Float64 ): CFSwappedFloat64; inline;
+function CFConvertDoubleSwappedToHost( arg: CFSwappedFloat64 ): Float64; inline;
 
 
 {$ifc TARGET_RT_LITTLE_ENDIAN}
 {$ifc TARGET_RT_LITTLE_ENDIAN}
 
 
@@ -259,9 +259,9 @@ begin
   CFConvertFloat32HostToSwapped := CFSwappedFloat32(arg);
   CFConvertFloat32HostToSwapped := CFSwappedFloat32(arg);
 end;
 end;
 
 
-function CFConvertFloat32SwappedToHost( arg: Float32 ): CFSwappedFloat32; inline;
+function CFConvertFloat32SwappedToHost( arg: CFSwappedFloat32 ): Float32; inline;
 begin
 begin
-  CFConvertFloat32SwappedToHost := CFSwappedFloat32(arg);
+  CFConvertFloat32SwappedToHost := Float32(arg);
 end;
 end;
 
 
 function CFConvertFloat64HostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
 function CFConvertFloat64HostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
@@ -269,9 +269,9 @@ begin
   CFConvertFloat64HostToSwapped := CFSwappedFloat64(arg);
   CFConvertFloat64HostToSwapped := CFSwappedFloat64(arg);
 end;
 end;
 
 
-function CFConvertFloat64SwappedToHost( arg: Float64 ): CFSwappedFloat64; inline;
+function CFConvertFloat64SwappedToHost( arg: CFSwappedFloat64 ): Float64; inline;
 begin
 begin
-  CFConvertFloat64SwappedToHost := CFSwappedFloat64(arg);
+  CFConvertFloat64SwappedToHost := Float64(arg);
 end;
 end;
 
 
 function CFConvertFloatHostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
 function CFConvertFloatHostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
@@ -279,19 +279,19 @@ begin
   CFConvertFloatHostToSwapped := CFSwappedFloat32(arg);
   CFConvertFloatHostToSwapped := CFSwappedFloat32(arg);
 end;
 end;
 
 
-function CFConvertFloatSwappedToHost( arg: Float32 ): CFSwappedFloat32; inline;
+function CFConvertFloatSwappedToHost( arg: CFSwappedFloat32 ): Float32; inline;
 begin
 begin
-  CFConvertFloatSwappedToHost := CFSwappedFloat32(arg);
+  CFConvertFloatSwappedToHost := Float32(arg);
 end;
 end;
 
 
-function CFConvertDoubleHostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
+function CFConvertDoubleHostToSwapped( arg: Float64): CFSwappedFloat64; inline;
 begin
 begin
   CFConvertDoubleHostToSwapped := CFSwappedFloat64(arg);
   CFConvertDoubleHostToSwapped := CFSwappedFloat64(arg);
 end;
 end;
 
 
-function CFConvertDoubleSwappedToHost( arg: Float64 ): CFSwappedFloat64; inline;
+function CFConvertDoubleSwappedToHost( arg: CFSwappedFloat64 ): Float64; inline;
 begin
 begin
-  CFConvertDoubleSwappedToHost := CFSwappedFloat64(arg);
+  CFConvertDoubleSwappedToHost := Float64(arg);
 end;
 end;
 
 
 {$elsec}
 {$elsec}
@@ -361,9 +361,9 @@ begin
   CFConvertFloat32HostToSwapped.v := CFSwapInt32(CFSwappedFloat32(arg).v);
   CFConvertFloat32HostToSwapped.v := CFSwapInt32(CFSwappedFloat32(arg).v);
 end;
 end;
 
 
-function CFConvertFloat32SwappedToHost( arg: Float32 ): CFSwappedFloat32; inline;
+function CFConvertFloat32SwappedToHost( arg: CFSwappedFloat32 ): Float32; inline;
 begin
 begin
-  CFConvertFloat32SwappedToHost.v := CFSwapInt32(CFSwappedFloat32(arg).v);
+  CFConvertFloat32SwappedToHost := Float32(CFSwappedFloat32(CFSwapInt32(arg.v)));
 end;
 end;
 
 
 function CFConvertFloat64HostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
 function CFConvertFloat64HostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
@@ -371,9 +371,9 @@ begin
   CFConvertFloat64HostToSwapped.v := CFSwapInt64(CFSwappedFloat64(arg).v);
   CFConvertFloat64HostToSwapped.v := CFSwapInt64(CFSwappedFloat64(arg).v);
 end;
 end;
 
 
-function CFConvertFloat64SwappedToHost( arg: Float64 ): CFSwappedFloat64; inline;
+function CFConvertFloat64SwappedToHost( arg: CFSwappedFloat64 ): Float64; inline;
 begin
 begin
-  CFConvertFloat64SwappedToHost.v := CFSwapInt64(CFSwappedFloat64(arg).v);
+  CFConvertFloat64SwappedToHost := Float64(CFSwappedFloat64(CFSwapInt64(arg.v)));
 end;
 end;
 
 
 function CFConvertFloatHostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
 function CFConvertFloatHostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
@@ -381,9 +381,9 @@ begin
   CFConvertFloatHostToSwapped.v := CFSwapInt32(CFSwappedFloat32(arg).v);
   CFConvertFloatHostToSwapped.v := CFSwapInt32(CFSwappedFloat32(arg).v);
 end;
 end;
 
 
-function CFConvertFloatSwappedToHost( arg: Float32 ): CFSwappedFloat32; inline;
+function CFConvertFloatSwappedToHost( arg: CFSwappedFloat32 ): Float32; inline;
 begin
 begin
-  CFConvertFloatSwappedToHost.v := CFSwapInt32(CFSwappedFloat32(arg).v);
+  CFConvertFloatSwappedToHost := Float32(CFSwappedFloat32(CFSwapInt32(arg.v)));
 end;
 end;
 
 
 function CFConvertDoubleHostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
 function CFConvertDoubleHostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
@@ -391,9 +391,9 @@ begin
   CFConvertDoubleHostToSwapped.v := CFSwapInt64(CFSwappedFloat64(arg).v);
   CFConvertDoubleHostToSwapped.v := CFSwapInt64(CFSwappedFloat64(arg).v);
 end;
 end;
 
 
-function CFConvertDoubleSwappedToHost( arg: Float64 ): CFSwappedFloat64; inline;
+function CFConvertDoubleSwappedToHost( arg: CFSwappedFloat64 ): Float64; inline;
 begin
 begin
-  CFConvertDoubleSwappedToHost.v := CFSwapInt64(CFSwappedFloat64(arg).v);
+  CFConvertDoubleSwappedToHost := Float64(CFSwappedFloat64(CFSwapInt64(arg.v)));
 end;
 end;
 {$endc}
 {$endc}
 
 

+ 22 - 22
packages/univint/src/FPCMacOSAll.pas

@@ -16004,7 +16004,7 @@ procedure CFBitVectorSetAllBits( bv: CFMutableBitVectorRef; value: CFBit ); exte
 }
 }
 {   Pascal Translation:  Peter N Lewis, <[email protected]>, August 2005 }
 {   Pascal Translation:  Peter N Lewis, <[email protected]>, August 2005 }
 {   Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
 {   Pascal Translation Updated:  Peter N Lewis, <[email protected]>, September 2005 }
-{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, April 2006 }
+{   Pascal Translation Updated:  Jonas Maebe, <[email protected]>, April 2006, February 2008 }
 {
 {
     Modified for use with Free Pascal
     Modified for use with Free Pascal
     Version 200
     Version 200
@@ -16069,13 +16069,13 @@ type
 	end;
 	end;
 
 
 function CFConvertFloat32HostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
 function CFConvertFloat32HostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
-function CFConvertFloat32SwappedToHost( arg: Float32 ): CFSwappedFloat32; inline;
+function CFConvertFloat32SwappedToHost( arg: CFSwappedFloat32 ): Float32; inline;
 function CFConvertFloat64HostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
 function CFConvertFloat64HostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
-function CFConvertFloat64SwappedToHost( arg: Float64 ): CFSwappedFloat64; inline;
+function CFConvertFloat64SwappedToHost( arg: CFSwappedFloat64 ): Float64; inline;
 function CFConvertFloatHostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
 function CFConvertFloatHostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
-function CFConvertFloatSwappedToHost( arg: Float32 ): CFSwappedFloat32; inline;
+function CFConvertFloatSwappedToHost( arg: CFSwappedFloat32 ): Float32; inline;
 function CFConvertDoubleHostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
 function CFConvertDoubleHostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
-function CFConvertDoubleSwappedToHost( arg: Float64 ): CFSwappedFloat64; inline;
+function CFConvertDoubleSwappedToHost( arg: CFSwappedFloat64 ): Float64; inline;
 
 
 {$ifc TARGET_RT_LITTLE_ENDIAN}
 {$ifc TARGET_RT_LITTLE_ENDIAN}
 
 
@@ -270570,9 +270570,9 @@ begin
   CFConvertFloat32HostToSwapped := CFSwappedFloat32(arg);
   CFConvertFloat32HostToSwapped := CFSwappedFloat32(arg);
 end;
 end;
 
 
-function CFConvertFloat32SwappedToHost( arg: Float32 ): CFSwappedFloat32; inline;
+function CFConvertFloat32SwappedToHost( arg: CFSwappedFloat32 ): Float32; inline;
 begin
 begin
-  CFConvertFloat32SwappedToHost := CFSwappedFloat32(arg);
+  CFConvertFloat32SwappedToHost := Float32(arg);
 end;
 end;
 
 
 function CFConvertFloat64HostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
 function CFConvertFloat64HostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
@@ -270580,9 +270580,9 @@ begin
   CFConvertFloat64HostToSwapped := CFSwappedFloat64(arg);
   CFConvertFloat64HostToSwapped := CFSwappedFloat64(arg);
 end;
 end;
 
 
-function CFConvertFloat64SwappedToHost( arg: Float64 ): CFSwappedFloat64; inline;
+function CFConvertFloat64SwappedToHost( arg: CFSwappedFloat64 ): Float64; inline;
 begin
 begin
-  CFConvertFloat64SwappedToHost := CFSwappedFloat64(arg);
+  CFConvertFloat64SwappedToHost := Float64(arg);
 end;
 end;
 
 
 function CFConvertFloatHostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
 function CFConvertFloatHostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
@@ -270590,19 +270590,19 @@ begin
   CFConvertFloatHostToSwapped := CFSwappedFloat32(arg);
   CFConvertFloatHostToSwapped := CFSwappedFloat32(arg);
 end;
 end;
 
 
-function CFConvertFloatSwappedToHost( arg: Float32 ): CFSwappedFloat32; inline;
+function CFConvertFloatSwappedToHost( arg: CFSwappedFloat32 ): Float32; inline;
 begin
 begin
-  CFConvertFloatSwappedToHost := CFSwappedFloat32(arg);
+  CFConvertFloatSwappedToHost := Float32(arg);
 end;
 end;
 
 
-function CFConvertDoubleHostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
+function CFConvertDoubleHostToSwapped( arg: Float64): CFSwappedFloat64; inline;
 begin
 begin
   CFConvertDoubleHostToSwapped := CFSwappedFloat64(arg);
   CFConvertDoubleHostToSwapped := CFSwappedFloat64(arg);
 end;
 end;
 
 
-function CFConvertDoubleSwappedToHost( arg: Float64 ): CFSwappedFloat64; inline;
+function CFConvertDoubleSwappedToHost( arg: CFSwappedFloat64 ): Float64; inline;
 begin
 begin
-  CFConvertDoubleSwappedToHost := CFSwappedFloat64(arg);
+  CFConvertDoubleSwappedToHost := Float64(arg);
 end;
 end;
 
 
 {$elsec}
 {$elsec}
@@ -270672,9 +270672,9 @@ begin
   CFConvertFloat32HostToSwapped.v := CFSwapInt32(CFSwappedFloat32(arg).v);
   CFConvertFloat32HostToSwapped.v := CFSwapInt32(CFSwappedFloat32(arg).v);
 end;
 end;
 
 
-function CFConvertFloat32SwappedToHost( arg: Float32 ): CFSwappedFloat32; inline;
+function CFConvertFloat32SwappedToHost( arg: CFSwappedFloat32 ): Float32; inline;
 begin
 begin
-  CFConvertFloat32SwappedToHost.v := CFSwapInt32(CFSwappedFloat32(arg).v);
+  CFConvertFloat32SwappedToHost := Float32(CFSwappedFloat32(CFSwapInt32(arg.v)));
 end;
 end;
 
 
 function CFConvertFloat64HostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
 function CFConvertFloat64HostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
@@ -270682,9 +270682,9 @@ begin
   CFConvertFloat64HostToSwapped.v := CFSwapInt64(CFSwappedFloat64(arg).v);
   CFConvertFloat64HostToSwapped.v := CFSwapInt64(CFSwappedFloat64(arg).v);
 end;
 end;
 
 
-function CFConvertFloat64SwappedToHost( arg: Float64 ): CFSwappedFloat64; inline;
+function CFConvertFloat64SwappedToHost( arg: CFSwappedFloat64 ): Float64; inline;
 begin
 begin
-  CFConvertFloat64SwappedToHost.v := CFSwapInt64(CFSwappedFloat64(arg).v);
+  CFConvertFloat64SwappedToHost := Float64(CFSwappedFloat64(CFSwapInt64(arg.v)));
 end;
 end;
 
 
 function CFConvertFloatHostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
 function CFConvertFloatHostToSwapped( arg: Float32 ): CFSwappedFloat32; inline;
@@ -270692,9 +270692,9 @@ begin
   CFConvertFloatHostToSwapped.v := CFSwapInt32(CFSwappedFloat32(arg).v);
   CFConvertFloatHostToSwapped.v := CFSwapInt32(CFSwappedFloat32(arg).v);
 end;
 end;
 
 
-function CFConvertFloatSwappedToHost( arg: Float32 ): CFSwappedFloat32; inline;
+function CFConvertFloatSwappedToHost( arg: CFSwappedFloat32 ): Float32; inline;
 begin
 begin
-  CFConvertFloatSwappedToHost.v := CFSwapInt32(CFSwappedFloat32(arg).v);
+  CFConvertFloatSwappedToHost := Float32(CFSwappedFloat32(CFSwapInt32(arg.v)));
 end;
 end;
 
 
 function CFConvertDoubleHostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
 function CFConvertDoubleHostToSwapped( arg: Float64 ): CFSwappedFloat64; inline;
@@ -270702,9 +270702,9 @@ begin
   CFConvertDoubleHostToSwapped.v := CFSwapInt64(CFSwappedFloat64(arg).v);
   CFConvertDoubleHostToSwapped.v := CFSwapInt64(CFSwappedFloat64(arg).v);
 end;
 end;
 
 
-function CFConvertDoubleSwappedToHost( arg: Float64 ): CFSwappedFloat64; inline;
+function CFConvertDoubleSwappedToHost( arg: CFSwappedFloat64 ): Float64; inline;
 begin
 begin
-  CFConvertDoubleSwappedToHost.v := CFSwapInt64(CFSwappedFloat64(arg).v);
+  CFConvertDoubleSwappedToHost := Float64(CFSwappedFloat64(CFSwapInt64(arg.v)));
 end;
 end;
 {$endc}
 {$endc}
 
 

+ 4 - 4
rtl/darwin/Makefile

@@ -1,5 +1,5 @@
 #
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/01/22]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/01/24]
 #
 #
 default: all
 default: all
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
 MAKEFILETARGETS=i386-linux i386-go32v2 i386-win32 i386-os2 i386-freebsd i386-beos i386-netbsd i386-solaris i386-qnx i386-netware i386-openbsd i386-wdosx i386-darwin i386-emx i386-watcom i386-netwlibc i386-wince i386-embedded i386-symbian m68k-linux m68k-freebsd m68k-netbsd m68k-amiga m68k-atari m68k-openbsd m68k-palmos m68k-embedded powerpc-linux powerpc-netbsd powerpc-amiga powerpc-macos powerpc-darwin powerpc-morphos powerpc-embedded sparc-linux sparc-netbsd sparc-solaris sparc-embedded x86_64-linux x86_64-freebsd x86_64-darwin x86_64-win64 x86_64-embedded arm-linux arm-palmos arm-wince arm-gba arm-nds arm-embedded arm-symbian powerpc64-linux powerpc64-darwin powerpc64-embedded
@@ -2381,7 +2381,7 @@ rtlconsts$(PPUEXT) : $(OBJPASDIR)/rtlconsts.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PP
 strutils$(PPUEXT) : $(OBJPASDIR)/strutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
 strutils$(PPUEXT) : $(OBJPASDIR)/strutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
 		    sysutils$(PPUEXT)
 		    sysutils$(PPUEXT)
 	$(COMPILER) $(OBJPASDIR)/strutils.pp
 	$(COMPILER) $(OBJPASDIR)/strutils.pp
-variants$(PPUEXT) : $(INC)/variants.pp sysutils$(PPUEXT) sysconst$(PPUEXT) varutils$(PPUEXT) typinfo$(PPUEXT) rtlconsts$(PPUEXT)
+variants$(PPUEXT) : $(INC)/variants.pp sysutils$(PPUEXT) sysconst$(PPUEXT) varutils$(PPUEXT) typinfo$(PPUEXT) rtlconsts$(PPUEXT) math$(PPUEXT)
 	$(COMPILER) -Fi$(INC) $(INC)/variants.pp
 	$(COMPILER) -Fi$(INC) $(INC)/variants.pp
 convutils$(PPUEXT) : $(OBJPASDIR)/convutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
 convutils$(PPUEXT) : $(OBJPASDIR)/convutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
 		    sysutils$(PPUEXT)
 		    sysutils$(PPUEXT)
@@ -2399,8 +2399,8 @@ mmx$(PPUEXT) : $(PROCINC)/mmx.pp cpu$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT)
 getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)
 getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)
 heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
 heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
 	$(COMPILER) -Sg $(INC)/heaptrc.pp
 	$(COMPILER) -Sg $(INC)/heaptrc.pp
-lineinfo$(PPUEXT) : $(INC)/lineinfo.pp $(SYSTEMUNIT)$(PPUEXT) strings$(PPUEXT)
-lnfodwrf$(PPUEXT) : $(INC)/lnfodwrf.pp $(SYSTEMUNIT)$(PPUEXT) strings$(PPUEXT)
+lineinfo$(PPUEXT) : $(INC)/lineinfo.pp $(SYSTEMUNIT)$(PPUEXT) strings$(PPUEXT) $(INC)/exeinfo.pp
+lnfodwrf$(PPUEXT) : $(INC)/lnfodwrf.pp $(SYSTEMUNIT)$(PPUEXT) strings$(PPUEXT) $(INC)/exeinfo.pp lineinfo$(PPUEXT)
 charset$(PPUEXT) : $(INC)/charset.pp objpas$(PPUEXT)
 charset$(PPUEXT) : $(INC)/charset.pp objpas$(PPUEXT)
 ucomplex$(PPUEXT) : $(INC)/ucomplex.pp math$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) math$(PPUEXT)
 ucomplex$(PPUEXT) : $(INC)/ucomplex.pp math$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) math$(PPUEXT)
 termio$(PPUEXT) : baseunix$(PPUEXT)
 termio$(PPUEXT) : baseunix$(PPUEXT)

+ 3 - 3
rtl/darwin/Makefile.fpc

@@ -213,7 +213,7 @@ strutils$(PPUEXT) : $(OBJPASDIR)/strutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUE
                     sysutils$(PPUEXT)
                     sysutils$(PPUEXT)
         $(COMPILER) $(OBJPASDIR)/strutils.pp
         $(COMPILER) $(OBJPASDIR)/strutils.pp
 
 
-variants$(PPUEXT) : $(INC)/variants.pp sysutils$(PPUEXT) sysconst$(PPUEXT) varutils$(PPUEXT) typinfo$(PPUEXT) rtlconsts$(PPUEXT)
+variants$(PPUEXT) : $(INC)/variants.pp sysutils$(PPUEXT) sysconst$(PPUEXT) varutils$(PPUEXT) typinfo$(PPUEXT) rtlconsts$(PPUEXT) math$(PPUEXT)
         $(COMPILER) -Fi$(INC) $(INC)/variants.pp
         $(COMPILER) -Fi$(INC) $(INC)/variants.pp
 
 
 convutils$(PPUEXT) : $(OBJPASDIR)/convutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
 convutils$(PPUEXT) : $(OBJPASDIR)/convutils.pp objpas$(PPUEXT) $(SYSTEMUNIT)$(PPUEXT) \
@@ -250,9 +250,9 @@ getopts$(PPUEXT) : $(INC)/getopts.pp $(SYSTEMUNIT)$(PPUEXT)
 heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
 heaptrc$(PPUEXT) : $(INC)/heaptrc.pp $(SYSTEMUNIT)$(PPUEXT)
         $(COMPILER) -Sg $(INC)/heaptrc.pp
         $(COMPILER) -Sg $(INC)/heaptrc.pp
 
 
-lineinfo$(PPUEXT) : $(INC)/lineinfo.pp $(SYSTEMUNIT)$(PPUEXT) strings$(PPUEXT)
+lineinfo$(PPUEXT) : $(INC)/lineinfo.pp $(SYSTEMUNIT)$(PPUEXT) strings$(PPUEXT) $(INC)/exeinfo.pp
 
 
-lnfodwrf$(PPUEXT) : $(INC)/lnfodwrf.pp $(SYSTEMUNIT)$(PPUEXT) strings$(PPUEXT)
+lnfodwrf$(PPUEXT) : $(INC)/lnfodwrf.pp $(SYSTEMUNIT)$(PPUEXT) strings$(PPUEXT) $(INC)/exeinfo.pp lineinfo$(PPUEXT)
 
 
 charset$(PPUEXT) : $(INC)/charset.pp objpas$(PPUEXT)
 charset$(PPUEXT) : $(INC)/charset.pp objpas$(PPUEXT)
 
 

+ 4 - 2
rtl/inc/exeinfo.pp

@@ -845,8 +845,9 @@ function FindSectionMachO32PPC(var e:TExeFile;const asecname:string;var secofs,s
 var
 var
    i: longint;
    i: longint;
    block:cmdblock;
    block:cmdblock;
-   symbolsSeg:  symbSeg;
+   symbolsSeg: symbSeg;
 begin
 begin
+  FindSectionMachO32PPC:=false;
   seek(e.f,e.sechdrofs);
   seek(e.f,e.sechdrofs);
   for i:= 1 to e.nsects do
   for i:= 1 to e.nsects do
     begin
     begin
@@ -859,13 +860,14 @@ begin
               secofs:=symbolsSeg.symoff;
               secofs:=symbolsSeg.symoff;
               { the caller will divide again by sizeof(tstab) }
               { the caller will divide again by sizeof(tstab) }
               seclen:=symbolsSeg.nsyms*sizeof(tstab);
               seclen:=symbolsSeg.nsyms*sizeof(tstab);
+              FindSectionMachO32PPC:=true;
             end
             end
           else if asecname='.stabstr' then
           else if asecname='.stabstr' then
             begin
             begin
               secofs:=symbolsSeg.stroff;
               secofs:=symbolsSeg.stroff;
               seclen:=symbolsSeg.strsize;
               seclen:=symbolsSeg.strsize;
+              FindSectionMachO32PPC:=true;
             end;
             end;
-          FindSectionMachO32PPC:=true;
           exit;
           exit;
       end;
       end;
       Seek(e.f, FilePos (e.f) + block.cmdsize - sizeof(block));
       Seek(e.f, FilePos (e.f) + block.cmdsize - sizeof(block));

+ 1 - 1
rtl/inc/real2str.inc

@@ -173,7 +173,7 @@ const
         { the fractional part is not used for rounding later                }
         { the fractional part is not used for rounding later                }
         currprec := -1;
         currprec := -1;
         { instead, round based on the next whole digit }
         { instead, round based on the next whole digit }
-        if (trunc(intPartStack[stackPtr]-corrVal) > 5.0 - roundCorr) then
+        if (int(intPartStack[stackPtr]-corrVal) > 5.0 - roundCorr) then
            roundStr(temp,spos);
            roundStr(temp,spos);
         end;
         end;
 {$ifdef DEBUG_NASM}
 {$ifdef DEBUG_NASM}

+ 36 - 0
tests/tbs/tb0172a.pp

@@ -0,0 +1,36 @@
+{ Old file: tbs0204.pp }
+{ can typecast the result var in an assignment          OK 0.99.11 (PM) }
+
+{ boolean(byte) byte(boolean)
+  word(wordbool) wordbool(word)
+  longint(longbool) and longbool(longint)
+  must be accepted as var parameters
+  or a left of an assignment }
+
+procedure error;
+begin
+   Writeln('Error in tb0172a');
+   Halt(1);
+end;
+
+procedure test;
+var
+  b : shortint;
+  wb : smallint;
+  lb : longint;
+
+begin
+  b:=0;
+  wb:=0;
+  lb:=0;
+
+  byte(b):=128;
+  word(wb):=32768;
+  cardinal(lb):=$80000000;
+  if (b<>low(shortint)) or (wb<>low(smallint)) or (lb<>low(longint)) then
+    error;
+end;
+
+begin
+  test;
+end.

+ 10 - 0
tests/webtbf/tw10849.pp

@@ -0,0 +1,10 @@
+{ %fail }
+{ %opt=-Se1w2 }
+
+var
+  pc: pchar;
+  m,m1: longword;
+begin
+  m:=1;
+  pc^:=char(m-(m1*10)+byte('0'));
+end.

+ 25 - 0
tests/webtbs/tw10790.pp

@@ -0,0 +1,25 @@
+{ %OPT=-gh }
+
+{$ifdef fpc}
+{$mode delphi}
+{$endif}
+
+program failtest;
+
+type
+   TMyClass = class
+      constructor Create;
+   end;
+    
+constructor TMyClass.Create;
+begin
+   Fail;
+end;
+
+var
+   MyClass : TMyClass;
+
+begin
+   HaltOnNotReleased := true;
+   MyClass := TMyClass.Create;
+end.

+ 74 - 0
tests/webtbs/tw10815.pp

@@ -0,0 +1,74 @@
+{ %skiptarget=go32v2 }
+
+program MaxThread;
+
+{$mode objfpc}{$H+}
+
+uses
+ {$ifdef unix}
+ cthreads,
+ {$endif}
+ Classes, SysUtils;
+ { add your units here }
+
+
+type
+ ThProva = class(TThread)
+ private
+   Number: Integer;
+ protected
+   procedure Execute; override;
+ public
+   constructor Create(ThreadNumber: Integer);
+ end;
+
+var
+ threadsfinished: Integer;
+
+
+constructor ThProva.Create(ThreadNumber: Integer);
+begin
+ self.Number:= ThreadNumber;
+ self.FreeOnTerminate:= true;
+ inherited Create(true);
+end;
+
+procedure ThProva.Execute;
+begin
+ WriteLn('I am the thread number '+ IntToStr(Number));
+ Terminate;
+ { not exactly finished yet, but good enough }
+ interlockedincrement(threadsfinished);
+end;
+
+
+var
+ ThreadNumber: Integer;
+ thr: thprova;
+begin
+ ThreadNumber:= 0;
+ WriteLn('Begin');
+ { needs to be > 410 because at least on Mac OS X and Linux you can start }
+ { about 400 threads before you run into trouble if they aren't finished  }
+ while (threadnumber < 500) do
+   begin
+     try
+       Inc(ThreadNumber);
+       thr:=ThProva.Create(Threadnumber);
+       thr.resume;
+     Except on e: Exception do
+       begin
+         WriteLn(e.Message);
+         halt(1);
+       end;
+     end;
+     if (threadnumber mod 16) = 0 then
+       while (threadsfinished<>threadnumber) do
+         { let the started threads to finish }
+         sleep(70);
+   end;
+  while (threadsfinished<>threadnumber) do
+    { give some time to the started threads to finish }
+    sleep(100);
+  sleep(200)
+end.