Skip to content

Commit

Permalink
Fix Android builds
Browse files Browse the repository at this point in the history
  • Loading branch information
dd86k committed Jun 4, 2024
1 parent f733af4 commit 33539d0
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/adbg/os/file.d
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,12 @@ version (Windows) {
private enum BLKGETSIZE64 = cast(int)_IOR!(0x12,114,size_t.sizeof);
private alias BLOCKSIZE = BLKGETSIZE64;

private extern (C) int ioctl(int,long,...);
version (Android)
alias off_t = int;
else
alias off_t = long;

private extern (C) int ioctl(int,off_t,...);

private alias OSHANDLE = int;
}
Expand Down Expand Up @@ -150,6 +155,11 @@ version (Windows) {
if (position < 0)
return -1;
return position;
} else version (Android) {
position = lseek(file.handle, position, origin);
if (position < 0)
return -1;
return position;
} else version (Posix) {
position = lseek64(file.handle, position, origin);
if (position < 0)
Expand All @@ -165,6 +175,8 @@ version (Windows) {
return i.QuadPart;
} else version (OSX) {
return lseek(file.handle, 0, SEEK_CUR);
} else version (Android) {
return lseek(file.handle, 0, SEEK_CUR);
} else version (Posix) {
return lseek64(file.handle, 0, SEEK_CUR);
}
Expand Down

0 comments on commit 33539d0

Please sign in to comment.