mirror of
https://github.com/vlang/v.git
synced 2023-08-10 21:13:21 +03:00
os: fix build issue caused by fileno on *BSD
This commit is contained in:
parent
a3bd8d3e4c
commit
c7501e2d3d
@ -301,7 +301,11 @@ pub fn fileno(cfile voidptr) int {
|
|||||||
$if windows {
|
$if windows {
|
||||||
return C._fileno(cfile)
|
return C._fileno(cfile)
|
||||||
} $else {
|
} $else {
|
||||||
return C.fileno(cfile)
|
cfile_casted := &C.FILE(0) // FILE* cfile_casted = 0;
|
||||||
|
cfile_casted = cfile
|
||||||
|
// Required on FreeBSD/OpenBSD/NetBSD as stdio.h defines fileno(..) with a macro
|
||||||
|
// that performs a field access on its argument without casting from void*.
|
||||||
|
return C.fileno(cfile_casted)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user