From 72dae345e4218c9ee4410f3738a86c3bbcb1d694 Mon Sep 17 00:00:00 2001 From: Dave Reisner Date: Sat, 29 Jun 2019 12:58:26 -0400 Subject: 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 --- meson.build | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/meson.build b/meson.build index fe4269dc..453e2282 100644 --- a/meson.build +++ b/meson.build @@ -158,6 +158,21 @@ foreach member : [ conf.set('HAVE_' + '_'.join([member[0], member[1]]).underscorify().to_upper(), have) endforeach +foreach type : [ + # type # program prefix # fallback + ['mode_t', '''#include ''', 'unsigned int'], + ['uid_t', '''#include ''', 'unsigned int'], + ['off_t', '''#include ''', 'signed int'], + ['pid_t', '''#include ''', 'signed int'], + ['size_t', '''#include ''', 'unsigned int'], + ['ssize_t', '''#include ''', 'signed int'], + ['int64_t', '''#include ''', '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') conf.set('FSSTATSTYPE', 'struct statvfs') elif conf.has('HAVE_STRUCT_STATFS_F_FLAGS') -- cgit v1.2.3-24-g4f1b