diff options
-rw-r--r-- | meson.build | 3 | ||||
-rw-r--r-- | test/registry.c | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/meson.build b/meson.build index 046fc54..79acda4 100644 --- a/meson.build +++ b/meson.build @@ -89,6 +89,9 @@ if get_option('default-options') != '' else configh_data.set('DEFAULT_XKB_OPTIONS', 'NULL') endif +if cc.has_header('unistd.h') + configh_data.set('HAVE_UNISTD_H', 1) +endif if cc.links('int main(){if(__builtin_expect(1<0,0)){}}', name: '__builtin_expect') configh_data.set('HAVE___BUILTIN_EXPECT', 1) endif diff --git a/test/registry.c b/test/registry.c index fc5f6da..fab3b69 100644 --- a/test/registry.c +++ b/test/registry.c @@ -24,6 +24,9 @@ #include "config.h" #include <assert.h> +#if HAVE_UNISTD_H +#include <unistd.h> +#endif #include <stdarg.h> #include <stdio.h> #include <sys/stat.h> |