summaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorDave Reisner <dreisner@archlinux.org>2019-06-29 12:58:26 -0400
committerAllan McRae <allan@archlinux.org>2019-08-05 18:21:17 +1000
commit72dae345e4218c9ee4410f3738a86c3bbcb1d694 (patch)
treefcf0403e8f51a9b96c4e0fcab25c58f645b1d6d1 /meson.build
parentb3dd02236c8098f29595587714ffb1945972d60a (diff)
downloadpacman-72dae345e4218c9ee4410f3738a86c3bbcb1d694.tar.gz
pacman-72dae345e4218c9ee4410f3738a86c3bbcb1d694.zip
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>
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build15
1 files changed, 15 insertions, 0 deletions
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 <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')
conf.set('FSSTATSTYPE', 'struct statvfs')
elif conf.has('HAVE_STRUCT_STATFS_F_FLAGS')