Browse Source

Merged revisions 9737-9739 via svnmerge from
svn+ssh://[email protected]/FPC/svn/fpc/trunk

........
r9737 | joost | 2008-01-13 17:44:16 +0100 (Sun, 13 Jan 2008) | 1 line

* Re-generated for all platforms
........
r9738 | florian | 2008-01-13 18:04:48 +0100 (Sun, 13 Jan 2008) | 2 lines

* load procedure variables in comobj unit with proper names, partly resolves #10615
........
r9739 | florian | 2008-01-13 18:45:49 +0100 (Sun, 13 Jan 2008) | 2 lines

* fixed initialization, resolves #10615
........

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

marco 17 years ago
parent
commit
6a68b1b7e5
2 changed files with 35 additions and 10 deletions
  1. 23 3
      packages/fcl-db/tests/Makefile
  2. 12 7
      packages/winunits-base/src/comobj.pp

+ 23 - 3
packages/fcl-db/tests/Makefile

@@ -1,11 +1,12 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/10/21]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2008/01/15]
 #
 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-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
 BSDs = freebsd netbsd openbsd darwin
 UNIXs = linux $(BSDs) solaris qnx
 LIMIT83fs = go32v2 os2 emx watcom
+OSNeedsComspecToRunBatch = go32v2 watcom
 FORCE:
 .PHONY: FORCE
 override PATH:=$(patsubst %/,%,$(subst \,/,$(PATH)))
@@ -56,6 +57,11 @@ else
 SRCBATCHEXT=.bat
 endif
 endif
+ifdef COMSPEC
+ifneq ($(findstring $(OS_SOURCE),$(OSNeedsComspecToRunBatch)),)
+RUNBATCH=$(COMSPEC) /C
+endif
+endif
 ifdef inUnix
 PATHSEP=/
 else
@@ -102,7 +108,11 @@ ifndef FPC
 FPCPROG:=$(strip $(wildcard $(addsuffix /fpc$(SRCEXEEXT),$(SEARCHPATH))))
 ifneq ($(FPCPROG),)
 FPCPROG:=$(firstword $(FPCPROG))
+ifneq ($(CPU_TARGET),)
+FPC:=$(shell $(FPCPROG) -P$(CPU_TARGET) -PB)
+else
 FPC:=$(shell $(FPCPROG) -PB)
+endif
 ifneq ($(findstring Error,$(FPC)),)
 override FPC=$(firstword $(strip $(wildcard $(addsuffix /ppc386$(SRCEXEEXT),$(SEARCHPATH)))))
 endif
@@ -352,6 +362,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 override TARGET_EXAMPLES+=dbtestframework
 endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+override TARGET_EXAMPLES+=dbtestframework
+endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 override TARGET_EXAMPLES+=dbtestframework
 endif
@@ -1257,6 +1270,9 @@ endif
 ifeq ($(FULL_TARGET),x86_64-freebsd)
 REQUIRE_PACKAGES_RTL=1
 endif
+ifeq ($(FULL_TARGET),x86_64-darwin)
+REQUIRE_PACKAGES_RTL=1
+endif
 ifeq ($(FULL_TARGET),x86_64-win64)
 REQUIRE_PACKAGES_RTL=1
 endif
@@ -1333,7 +1349,7 @@ override FPCOPT+=-FD$(NEW_BINUTILS_PATH)
 endif
 ifndef CROSSBOOTSTRAP
 ifneq ($(BINUTILSPREFIX),)
-override FPCOPT+=-XP$(BINUTILSPREFIX) 
+override FPCOPT+=-XP$(BINUTILSPREFIX)
 endif
 ifneq ($(BINUTILSPREFIX),)
 override FPCOPT+=-Xr$(RLINKPATH)
@@ -1465,9 +1481,13 @@ ifeq (,$(findstring -s ,$(COMPILER)))
 EXECPPAS=
 else
 ifeq ($(FULL_SOURCE),$(FULL_TARGET))
+ifdef RUNBATCH
+EXECPPAS:=@$(RUNBATCH) $(PPAS)
+else
 EXECPPAS:=@$(PPAS)
 endif
 endif
+endif
 ifdef TARGET_RSTS
 override RSTFILES=$(addsuffix $(RSTEXT),$(TARGET_RSTS))
 override CLEANRSTFILES+=$(RSTFILES)

+ 12 - 7
packages/winunits-base/src/comobj.pp

@@ -213,6 +213,7 @@ unit comobj;
       CoReleaseServerProcess : TCoReleaseServerProcessProc = nil;
       CoResumeClassObjects : TCoResumeClassObjectsProc = nil;
       CoSuspendClassObjects : TCoSuspendClassObjectsProc = nil;
+      CoInitFlags : Longint = -1;
 
 implementation
 
@@ -1035,16 +1036,20 @@ initialization
   Ole32Dll:=GetModuleHandle('ole32.dll');
   if Ole32Dll<>0 then
     begin
-      Pointer(CoCreateInstanceEx):=GetProcAddress(Ole32Dll,'CoCreateInstanceExProc');
-      Pointer(CoInitializeEx):=GetProcAddress(Ole32Dll,'CoInitializeExProc');
-      Pointer(CoAddRefServerProcess):=GetProcAddress(Ole32Dll,'CoAddRefServerProcessProc');
-      Pointer(CoReleaseServerProcess):=GetProcAddress(Ole32Dll,'CoReleaseServerProcessProc');
-      Pointer(CoResumeClassObjects):=GetProcAddress(Ole32Dll,'CoResumeClassObjectsProc');
-      Pointer(CoSuspendClassObjects):=GetProcAddress(Ole32Dll,'CoSuspendClassObjectsProc');
+      Pointer(CoCreateInstanceEx):=GetProcAddress(Ole32Dll,'CoCreateInstanceEx');
+      Pointer(CoInitializeEx):=GetProcAddress(Ole32Dll,'CoInitializeEx');
+      Pointer(CoAddRefServerProcess):=GetProcAddress(Ole32Dll,'CoAddRefServerProcess');
+      Pointer(CoReleaseServerProcess):=GetProcAddress(Ole32Dll,'CoReleaseServerProcess');
+      Pointer(CoResumeClassObjects):=GetProcAddress(Ole32Dll,'CoResumeClassObjects');
+      Pointer(CoSuspendClassObjects):=GetProcAddress(Ole32Dll,'CoSuspendClassObjects');
     end;
 
   if not(IsLibrary) then
-    Initialized:=Succeeded(CoInitialize(nil));
+    if (CoInitFlags=-1) or not(assigned(comobj.CoInitializeEx)) then
+      Initialized:=Succeeded(CoInitialize(nil))
+    else
+      Initialized:=Succeeded(comobj.CoInitializeEx(nil, CoInitFlags));
+
   SafeCallErrorProc:=@SafeCallErrorHandler;
   VarDispProc:=@ComObjDispatchInvoke;
   DispCallByIDProc:=@DoDispCallByID;