Fix compile on some platforms
Controlling the type of getmntinfo's param was decided by whether or not we had the statvfs type avaliable. But getmntinfo uses statfs regardless of this except on netbsd where it uses statvfs. Add a check to detect which type our version of the function uses.
This commit is contained in:
parent
ffde12cebd
commit
85ab0307d7
1 changed files with 16 additions and 1 deletions
17
meson.build
17
meson.build
|
@ -182,7 +182,22 @@ foreach type : [
|
||||||
endif
|
endif
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
if conf.has('HAVE_STRUCT_STATVFS_F_FLAG')
|
|
||||||
|
if conf.has('HAVE_GETMNTINFO')
|
||||||
|
if cc.compiles('''
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <sys/statvfs.h>
|
||||||
|
|
||||||
|
void func() {
|
||||||
|
struct statvfs *buf;
|
||||||
|
getmntinfo(&buf, 0);
|
||||||
|
}
|
||||||
|
''')
|
||||||
|
conf.set('FSSTATSTYPE', 'struct statvfs')
|
||||||
|
else
|
||||||
|
conf.set('FSSTATSTYPE', 'struct statfs')
|
||||||
|
endif
|
||||||
|
elif conf.has('HAVE_STRUCT_STATVFS_F_FLAG')
|
||||||
conf.set('FSSTATSTYPE', 'struct statvfs')
|
conf.set('FSSTATSTYPE', 'struct statvfs')
|
||||||
elif conf.has('HAVE_STRUCT_STATFS_F_FLAGS')
|
elif conf.has('HAVE_STRUCT_STATFS_F_FLAGS')
|
||||||
conf.set('FSSTATSTYPE', 'struct statfs')
|
conf.set('FSSTATSTYPE', 'struct statfs')
|
||||||
|
|
Loading…
Add table
Reference in a new issue