mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-27 11:30:35 +02:00
* fix compilation for mipsel-android (hopefully)
This commit is contained in:
parent
08e494ffd1
commit
dc5041d778
@ -406,12 +406,19 @@ end;
|
|||||||
|
|
||||||
{$endif}
|
{$endif}
|
||||||
|
|
||||||
|
{ on 32 bit systems, we should use the 64 bit time calls }
|
||||||
|
{$if (sizeof(time_t)<=4)}
|
||||||
|
{ mipsel-android doesn't have them as it is not part of newer android versions anymode }
|
||||||
|
{$if not(defined(ANDROID) and defined(CPU_MIPSEL))}
|
||||||
|
{$define USE_TIME64}
|
||||||
|
{$endif not(defined(ANDROID) and defined(CPU_MIPSEL))}
|
||||||
|
{$endif (sizeof(clong)<=4)}
|
||||||
|
|
||||||
Function FpFUtimens (handle: cint;constref times: TTimespecArr):cint;
|
Function FpFUtimens (handle: cint;constref times: TTimespecArr):cint;
|
||||||
var
|
var
|
||||||
tsa: Array[0..1] of timespec;
|
tsa: Array[0..1] of timespec;
|
||||||
begin
|
begin
|
||||||
{$if sizeof(clong)<=4}
|
{$ifdef USE_TIME64}
|
||||||
FpFUtimens:=do_syscall(syscall_nr_utimensat_time64,handle,TSysParam(nil),TSysParam(@times),0);
|
FpFUtimens:=do_syscall(syscall_nr_utimensat_time64,handle,TSysParam(nil),TSysParam(@times),0);
|
||||||
if (FpFUtimens>=0) or (fpgeterrno<>ESysENOSYS) then
|
if (FpFUtimens>=0) or (fpgeterrno<>ESysENOSYS) then
|
||||||
exit;
|
exit;
|
||||||
@ -421,9 +428,9 @@ begin
|
|||||||
tsa[1].tv_sec := times[1].tv_sec;
|
tsa[1].tv_sec := times[1].tv_sec;
|
||||||
tsa[1].tv_nsec := times[1].tv_nsec;
|
tsa[1].tv_nsec := times[1].tv_nsec;
|
||||||
FpFUtimens:=do_syscall(syscall_nr_utimensat,handle,TSysParam(nil),TSysParam(@tsa),0);
|
FpFUtimens:=do_syscall(syscall_nr_utimensat,handle,TSysParam(nil),TSysParam(@tsa),0);
|
||||||
{$else sizeof(clong)<=4}
|
{$else USE_TIME64}
|
||||||
FpFUtimens:=do_syscall(syscall_nr_utimensat,handle,TSysParam(nil),TSysParam(@times),0);
|
FpFUtimens:=do_syscall(syscall_nr_utimensat,handle,TSysParam(nil),TSysParam(@times),0);
|
||||||
{$endif sizeof(clong)<=4}
|
{$endif USE_TIME64}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
@ -551,10 +551,8 @@ Type
|
|||||||
|
|
||||||
function statx(dfd: cint; filename: PAnsiChar; flags,mask: cuint; var buf: tstatx):cint; {$ifdef FPC_USE_LIBC} cdecl; weakexternal name 'statx'; {$ENDIF}
|
function statx(dfd: cint; filename: PAnsiChar; flags,mask: cuint; var buf: tstatx):cint; {$ifdef FPC_USE_LIBC} cdecl; weakexternal name 'statx'; {$ENDIF}
|
||||||
|
|
||||||
{$ifndef android}
|
|
||||||
Function utimensat(dfd: cint; path:PAnsiChar;const times:TTimespecArr;flags:cint):cint; {$ifdef FPC_USE_LIBC} cdecl; external name 'utimensat'; {$ENDIF}
|
Function utimensat(dfd: cint; path:PAnsiChar;const times:TTimespecArr;flags:cint):cint; {$ifdef FPC_USE_LIBC} cdecl; external name 'utimensat'; {$ENDIF}
|
||||||
Function futimens(fd: cint; const times:TTimespecArr):cint; {$ifdef FPC_USE_LIBC} cdecl; external name 'futimens'; {$ENDIF}
|
Function futimens(fd: cint; const times:TTimespecArr):cint; {$ifdef FPC_USE_LIBC} cdecl; external name 'futimens'; {$ENDIF}
|
||||||
{$endif android}
|
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
|
|
||||||
@ -875,13 +873,19 @@ begin
|
|||||||
statx:=do_syscall(syscall_nr_statx,TSysParam(dfd),TSysParam(filename),TSysParam(flags),TSysParam(mask),TSysParam(@buf));
|
statx:=do_syscall(syscall_nr_statx,TSysParam(dfd),TSysParam(filename),TSysParam(flags),TSysParam(mask),TSysParam(@buf));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
{ on 32 bit systems, we should use the 64 bit time calls }
|
||||||
|
{$if (sizeof(time_t)<=4)}
|
||||||
|
{ mipsel-android doesn't have them as it is not part of newer android versions anymode }
|
||||||
|
{$if not(defined(ANDROID) and defined(CPU_MIPSEL))}
|
||||||
|
{$define USE_TIME64}
|
||||||
|
{$endif not(defined(ANDROID) and defined(CPU_MIPSEL))}
|
||||||
|
{$endif (sizeof(clong)<=4)}
|
||||||
|
|
||||||
{$ifndef android}
|
|
||||||
Function utimensat(dfd: cint; path:PAnsiChar;const times:TTimespecArr;flags:cint):cint;
|
Function utimensat(dfd: cint; path:PAnsiChar;const times:TTimespecArr;flags:cint):cint;
|
||||||
var
|
var
|
||||||
tsa: Array[0..1] of timespec;
|
tsa: Array[0..1] of timespec;
|
||||||
begin
|
begin
|
||||||
{$if sizeof(clong)<=4}
|
{$ifdef USE_TIME64}
|
||||||
utimensat:=do_syscall(syscall_nr_utimensat_time64,dfd,TSysParam(path),TSysParam(@times),0);
|
utimensat:=do_syscall(syscall_nr_utimensat_time64,dfd,TSysParam(path),TSysParam(@times),0);
|
||||||
if (utimensat>=0) or (fpgeterrno<>ESysENOSYS) then
|
if (utimensat>=0) or (fpgeterrno<>ESysENOSYS) then
|
||||||
exit;
|
exit;
|
||||||
@ -891,9 +895,9 @@ begin
|
|||||||
tsa[1].tv_sec := times[1].tv_sec;
|
tsa[1].tv_sec := times[1].tv_sec;
|
||||||
tsa[1].tv_nsec := times[1].tv_nsec;
|
tsa[1].tv_nsec := times[1].tv_nsec;
|
||||||
utimensat:=do_syscall(syscall_nr_utimensat,dfd,TSysParam(path),TSysParam(@tsa),0);
|
utimensat:=do_syscall(syscall_nr_utimensat,dfd,TSysParam(path),TSysParam(@tsa),0);
|
||||||
{$else sizeof(clong)<=4}
|
{$else USE_TIME64}
|
||||||
utimensat:=do_syscall(syscall_nr_utimensat,dfd,TSysParam(path),TSysParam(@times),0);
|
utimensat:=do_syscall(syscall_nr_utimensat,dfd,TSysParam(path),TSysParam(@times),0);
|
||||||
{$endif sizeof(clong)<=4}
|
{$endif USE_TIME64}
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -901,7 +905,7 @@ Function futimens(fd: cint; const times:TTimespecArr):cint;
|
|||||||
var
|
var
|
||||||
tsa: Array[0..1] of timespec;
|
tsa: Array[0..1] of timespec;
|
||||||
begin
|
begin
|
||||||
{$if sizeof(clong)<=4}
|
{$ifdef USE_TIME64}
|
||||||
futimens:=do_syscall(syscall_nr_utimensat_time64,fd,TSysParam(nil),TSysParam(@times),0);
|
futimens:=do_syscall(syscall_nr_utimensat_time64,fd,TSysParam(nil),TSysParam(@times),0);
|
||||||
if (futimens>=0) or (fpgeterrno<>ESysENOSYS) then
|
if (futimens>=0) or (fpgeterrno<>ESysENOSYS) then
|
||||||
exit;
|
exit;
|
||||||
@ -911,11 +915,10 @@ begin
|
|||||||
tsa[1].tv_sec := times[1].tv_sec;
|
tsa[1].tv_sec := times[1].tv_sec;
|
||||||
tsa[1].tv_nsec := times[1].tv_nsec;
|
tsa[1].tv_nsec := times[1].tv_nsec;
|
||||||
futimens:=do_syscall(syscall_nr_utimensat,fd,TSysParam(nil),TSysParam(@tsa),0);
|
futimens:=do_syscall(syscall_nr_utimensat,fd,TSysParam(nil),TSysParam(@tsa),0);
|
||||||
{$else sizeof(clong)<=4}
|
{$else USE_TIME64}
|
||||||
futimens:=do_syscall(syscall_nr_utimensat,fd,TSysParam(nil),TSysParam(@times),0);
|
futimens:=do_syscall(syscall_nr_utimensat,fd,TSysParam(nil),TSysParam(@times),0);
|
||||||
{$endif sizeof(clong)<=4}
|
{$endif USE_TIME64}
|
||||||
end;
|
end;
|
||||||
{$endif android}
|
|
||||||
|
|
||||||
{$endif not FPC_USE_LIBC}
|
{$endif not FPC_USE_LIBC}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user