meson: port over checks for types used from sys/types.h
These are defined by a POSIX standard, and we should assert that we have them, or define sane fallbacks (as per sys_types.h(0P)). Signed-off-by: Allan McRae <allan@archlinux.org>
This commit is contained in:
parent
b3dd02236c
commit
72dae345e4
1 changed files with 15 additions and 0 deletions
15
meson.build
15
meson.build
|
@ -158,6 +158,21 @@ foreach member : [
|
||||||
conf.set('HAVE_' + '_'.join([member[0], member[1]]).underscorify().to_upper(), have)
|
conf.set('HAVE_' + '_'.join([member[0], member[1]]).underscorify().to_upper(), have)
|
||||||
endforeach
|
endforeach
|
||||||
|
|
||||||
|
foreach type : [
|
||||||
|
# type # program prefix # fallback
|
||||||
|
['mode_t', '''#include <sys/types.h>''', 'unsigned int'],
|
||||||
|
['uid_t', '''#include <sys/types.h>''', 'unsigned int'],
|
||||||
|
['off_t', '''#include <sys/types.h>''', 'signed int'],
|
||||||
|
['pid_t', '''#include <sys/types.h>''', 'signed int'],
|
||||||
|
['size_t', '''#include <sys/types.h>''', 'unsigned int'],
|
||||||
|
['ssize_t', '''#include <sys/types.h>''', 'signed int'],
|
||||||
|
['int64_t', '''#include <stdint.h>''', 'signed long int'],
|
||||||
|
]
|
||||||
|
if not cc.has_type(type[0], prefix: type[1])
|
||||||
|
conf.set(type[0], type[2])
|
||||||
|
endif
|
||||||
|
endforeach
|
||||||
|
|
||||||
if conf.has('HAVE_STRUCT_STATVFS_F_FLAG')
|
if 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')
|
||||||
|
|
Loading…
Add table
Reference in a new issue