[gjs/master.msvc: 5/8] gjs_pch.hh: Check for alloca.h and syscall.h
- From: Chun-wei Fan <fanchunwei src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gjs/master.msvc: 5/8] gjs_pch.hh: Check for alloca.h and syscall.h
- Date: Mon, 12 Jul 2021 02:34:49 +0000 (UTC)
commit 5a7e9560a20c7e9cdf68a252265e85dd391165a1
Author: Chun-wei Fan <fanchunwei src gnome org>
Date: Wed Jul 7 17:58:58 2021 +0800
gjs_pch.hh: Check for alloca.h and syscall.h
These headers may not be available, depending on the system, so only
include them if they are found on the system.
gjs/gjs_pch.hh | 4 ++++
meson.build | 2 ++
2 files changed, 6 insertions(+)
---
diff --git a/gjs/gjs_pch.hh b/gjs/gjs_pch.hh
index 6dcda429..907a9c1a 100644
--- a/gjs/gjs_pch.hh
+++ b/gjs/gjs_pch.hh
@@ -28,7 +28,9 @@
#include <utility>
#include <vector>
+#ifdef HAVE_ALLOCA_H
#include <alloca.h>
+#endif
#include <assert.h>
#include <ctype.h>
#include <errno.h>
@@ -121,7 +123,9 @@
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
+#ifdef HAVE_SYSCALL_H
#include <syscall.h>
+#endif
#ifdef ENABLE_PROFILER
#include <sysprof-capture.h>
#endif
diff --git a/meson.build b/meson.build
index b97ad9e3..20e518b9 100644
--- a/meson.build
+++ b/meson.build
@@ -305,6 +305,8 @@ if build_readline
required: readline.found()))
endif
header_conf.set('USE_UNITY_BUILD', get_option('unity'))
+header_conf.set('HAVE_ALLOCA_H', cxx.check_header('alloca.h'))
+header_conf.set('HAVE_SYSCALL_H', cxx.check_header('syscall.h'))
header_conf.set('HAVE_SYS_SYSCALL_H', cxx.check_header('sys/syscall.h'))
header_conf.set('HAVE_UNISTD_H', cxx.check_header('unistd.h'))
header_conf.set('HAVE_SIGNAL_H', cxx.check_header('signal.h',
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]