* delphi fixes

This commit is contained in:
peter 2001-09-02 21:16:25 +00:00
parent d1d504ac2d
commit 1f4bac4fd0
3 changed files with 28 additions and 11 deletions

View File

@ -26,6 +26,10 @@ unit dmisc;
interface interface
{$ifndef linux}
{$define MSWindows}
{$endif}
uses uses
{$ifdef linux} {$ifdef linux}
Libc, Libc,
@ -244,7 +248,9 @@ end;
procedure getdate(var year,month,mday,wday : word); procedure getdate(var year,month,mday,wday : word);
begin begin
DecodeDateFully(Now,Year,Month,MDay,WDay); DecodeDate(Now,Year,Month,MDay);
WDay:=0;
// DecodeDateFully(Now,Year,Month,MDay,WDay);
end; end;
@ -654,7 +660,11 @@ end;
procedure setftime(var f;time : longint); procedure setftime(var f;time : longint);
begin begin
{$ifdef linux}
FileSetDate(filerec(f).name,Time); FileSetDate(filerec(f).name,Time);
{$else}
FileSetDate(filerec(f).handle,Time);
{$endif}
end; end;
@ -687,7 +697,7 @@ procedure getfattr(var f;var attr : word);
var var
l : longint; l : longint;
begin begin
l:=FileGetAttr(filerec(f).handle); l:=FileGetAttr(filerec(f).name);
attr:=l; attr:=l;
end; end;
{$endif} {$endif}
@ -695,8 +705,8 @@ end;
procedure setfattr(var f;attr : word); procedure setfattr(var f;attr : word);
begin begin
{$ifndef linux} {$ifdef MSWindows}
FileSetAttr(filerec(f).handle,attr); FileSetAttr(filerec(f).name,attr);
{$endif} {$endif}
end; end;
@ -826,7 +836,10 @@ End;
end. end.
{ {
$Log$ $Log$
Revision 1.5 2001-06-03 20:21:08 peter Revision 1.6 2001-09-02 21:16:25 peter
* delphi fixes
Revision 1.5 2001/06/03 20:21:08 peter
* Kylix fixes, mostly case names of units * Kylix fixes, mostly case names of units
Revision 1.4 2000/09/24 21:19:50 peter Revision 1.4 2000/09/24 21:19:50 peter

View File

@ -1,2 +1,2 @@
dcc32 -Di386 -DGDB -Ddelphi -CC -Ui386 -Utargets -E. -N. -$O+ ppc.dpr %1 %2 %3 %4 %5 %6 %7 %8 %9 dcc32 -Di386 -DGDB -Ddelphi -CC -Ui386 -Utargets -E. -N. -$O- ppc.dpr %1 %2 %3 %4 %5 %6 %7 %8 %9

View File

@ -32,6 +32,7 @@ unit widestr;
type type
tcompilerwidechar = word; tcompilerwidechar = word;
tcompilerwidecharptr = ^tcompilerwidechar;
{$ifdef delphi} {$ifdef delphi}
{ delphi doesn't allow pointer accessing as array } { delphi doesn't allow pointer accessing as array }
tcompilerwidechararray = array[0..0] of tcompilerwidechar; tcompilerwidechararray = array[0..0] of tcompilerwidechar;
@ -188,13 +189,13 @@ unit widestr;
*) *)
var var
source : pchar; source : pchar;
dest : pcompilerwidechar; dest : tcompilerwidecharptr;
i : longint; i : longint;
begin begin
setlengthwidestring(r,l); setlengthwidestring(r,l);
source:=p; source:=p;
r^.len:=l; r^.len:=l;
dest:=r^.data; dest:=tcompilerwidecharptr(r^.data);
for i:=1 to l do for i:=1 to l do
begin begin
if byte(source^)<128 then if byte(source^)<128 then
@ -224,11 +225,11 @@ unit widestr;
end; end;
*) *)
var var
source : pcompilerwidechar; source : tcompilerwidecharptr;
dest : pchar; dest : pchar;
i : longint; i : longint;
begin begin
source:=r^.data; source:=tcompilerwidecharptr(r^.data);
dest:=p; dest:=p;
for i:=1 to r^.len do for i:=1 to r^.len do
begin begin
@ -256,7 +257,10 @@ unit widestr;
end. end.
{ {
$Log$ $Log$
Revision 1.6 2001-07-08 21:00:16 peter Revision 1.7 2001-09-02 21:16:25 peter
* delphi fixes
Revision 1.6 2001/07/08 21:00:16 peter
* various widestring updates, it works now mostly without charset * various widestring updates, it works now mostly without charset
mapping supported mapping supported