Jelajahi Sumber

Merged revisions 9339,9478,9479 via svnmerge from
http://svn.freepascal.org/svn/fpc/trunk

........
r9339 | micha | 2007-11-27 22:54:51 +0200 (Вт, 27 ноя 2007) | 1 line

tdbf: fix compilation for wince: it has no OemToCharBuff
........
r9478 | yury | 2007-12-16 14:14:23 +0200 (Вс, 16 дек 2007) | 1 line

* Fixed compilation for wince.
........
r9479 | yury | 2007-12-16 14:28:11 +0200 (Вс, 16 дек 2007) | 1 line

* Fixed install for wince.
........

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

yury 18 tahun lalu
induk
melakukan
8741c705e1

+ 3 - 1
packages/fcl-db/src/dbase/Makefile

@@ -1,5 +1,5 @@
 #
-# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/10/30]
+# Don't edit, this file is generated by FPCMake Version 2.0.0 [2007/12/16]
 #
 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
@@ -244,10 +244,12 @@ override PACKAGE_NAME=fcl-db
 PACKAGEDIR_MAIN:=$(firstword $(subst /Makefile.fpc,,$(strip $(wildcard $(addsuffix /fcl-db/Makefile.fpc,$(PACKAGESDIR))))))
 ifneq ($(OS_TARGET),win32)
 ifneq ($(OS_TARGET),win64)
+ifneq ($(OS_TARGET),wince)
 INSTALL_UNITS+=dbf_wtil
 CLEAN_UNITS+=dbf_wtil
 endif
 endif
+endif
 ifeq ($(FULL_TARGET),i386-linux)
 override TARGET_UNITS+=dbf
 endif

+ 2 - 0
packages/fcl-db/src/dbase/Makefile.fpc

@@ -30,10 +30,12 @@ units=dbf_collate dbf_common dbf_cursor dbf_dbffile dbf_fields \
 # dbf_Wtil is needed on all targets except windows
 ifneq ($(OS_TARGET),win32)
 ifneq ($(OS_TARGET),win64)
+ifneq ($(OS_TARGET),wince)
 
 INSTALL_UNITS+=dbf_wtil
 CLEAN_UNITS+=dbf_wtil
 
+endif
 endif
 endif
 

+ 2 - 0
packages/fcl-db/src/dbase/dbf_common.pas

@@ -363,12 +363,14 @@ begin
   if Length = -1 then
     Length := StrLen(Src);
   Result := Length;
+{$ifndef WINCE}
   if (FromCP = GetOEMCP) and (ToCP = GetACP) then
     OemToCharBuff(Src, Dest, Length)
   else
   if (FromCP = GetACP) and (ToCP = GetOEMCP) then
     CharToOemBuff(Src, Dest, Length)
   else
+{$endif}
   if FromCP = ToCP then
   begin
     if Src <> Dest then

+ 6 - 1
packages/fcl-db/src/dbase/dbf_dbffile.pas

@@ -2720,6 +2720,10 @@ var
 {$endif}
 begin
 {$ifdef WINDOWS}
+{$ifdef wince}
+  FUserName:='cedevice';
+  FUserNameLen:=Length(FUserName);
+{$else}
   FUserNameLen := MAX_COMPUTERNAME_LENGTH+1;
   SetLength(FUserName, FUserNameLen);
   Windows.GetComputerName(PChar(FUserName), 
@@ -2728,7 +2732,8 @@ begin
     {$ifdef DELPHI_3}){$endif}
     );
   SetLength(FUserName, FUserNameLen);
-{$else}  
+{$endif wince}
+{$else}
 {$ifdef FPC}
   FpUname(TempName);
   FUserName := TempName.machine;

+ 10 - 0
packages/fcl-db/src/dbase/dbf_pgfile.pas

@@ -785,10 +785,15 @@ const
   LockStart  = LockOffset - 1000000000;
 
 function TPagedFile.LockSection(const Offset, Length: Cardinal; const Wait: Boolean): Boolean;
+{$ifndef wince}
   // assumes FNeedLock = true
 var
   Failed: Boolean;
+{$endif wince}
 begin
+{$ifdef wince}
+  Result := True;
+{$else}
   // FNeedLocks => FStream is of type TFileStream
   Failed := false;
   repeat
@@ -802,11 +807,16 @@ begin
         Failed := true;
     end;
   until Result or not Wait or Failed;
+{$endif wince}
 end;
 
 function TPagedFile.UnlockSection(const Offset, Length: Cardinal): Boolean;
 begin
+{$ifdef wince}
+  Result := True;
+{$else}
   Result := UnlockFile(TFileStream(FStream).Handle, Offset, 0, Length, 0);
+{$endif wince}
 end;
 
 function TPagedFile.LockAllPages(const Wait: Boolean): Boolean;