diff options
author | Christian Persch <chpe@src.gnome.org> | 2023-03-08 20:36:47 +0100 |
---|---|---|
committer | Christian Persch <chpe@src.gnome.org> | 2023-03-08 20:36:47 +0100 |
commit | 75543c3b30dbf696b084e927dabbf52a41d32638 (patch) | |
tree | f53a025d6bf341aecdc4d2dac3cd3fd45aee794c | |
parent | bd4f781d168859eb42943a23487422224124467c (diff) | |
download | vte-75543c3b30dbf696b084e927dabbf52a41d32638.tar.gz |
all: Use __has_include
... instead of checking for header presence from meson.build.
-rw-r--r-- | meson.build | 21 | ||||
-rw-r--r-- | src/dumpkeys.c | 7 | ||||
-rw-r--r-- | src/mev.c | 2 | ||||
-rw-r--r-- | src/missing.cc | 3 | ||||
-rw-r--r-- | src/pty.cc | 9 | ||||
-rw-r--r-- | src/vte.cc | 12 | ||||
-rw-r--r-- | src/vteaccess.cc | 2 | ||||
-rw-r--r-- | src/vtegtk.cc | 2 | ||||
-rw-r--r-- | src/vteseq.cc | 2 |
9 files changed, 22 insertions, 38 deletions
diff --git a/meson.build b/meson.build index 62bfefdf..c2b10873 100644 --- a/meson.build +++ b/meson.build @@ -253,27 +253,6 @@ foreach f: libc_feature_defines config_h.set(f[0], f[1]) endforeach -# Check headers - -check_headers = [ - 'locale.h', - 'pty.h', - 'stropts.h', - 'sys/resource.h', - 'sys/select.h', - 'sys/stream.h', - 'sys/syslimits.h', - 'sys/types.h', - 'sys/wait.h', - 'termios.h', - 'util.h', - 'wchar.h', -] - -foreach header: check_headers - config_h.set('HAVE_' + header.underscorify().to_upper(), cxx.has_header(header)) -endforeach - # Check for symbols check_symbols_required = [ diff --git a/src/dumpkeys.c b/src/dumpkeys.c index 08a72d23..53a2f588 100644 --- a/src/dumpkeys.c +++ b/src/dumpkeys.c @@ -15,11 +15,12 @@ * along with this library. If not, see <https://www.gnu.org/licenses/>. */ -#include <config.h> -#ifdef HAVE_SYS_TYPES_H +#include "config.h" + +#if __has_include(<sys/types.h>) #include <sys/types.h> #endif -#ifdef HAVE_SYS_SELECT_H +#if __has_include(<sys/select.h>) #include <sys/select.h> #endif #include <termios.h> @@ -27,7 +27,7 @@ #include <glib.h> #include "caps.hh" -#ifdef HAVE_SYS_SELECT_H +#if __has_include(<sys/select.h>) #include <sys/select.h> #endif diff --git a/src/missing.cc b/src/missing.cc index 469b3aff..ebaba4e1 100644 --- a/src/missing.cc +++ b/src/missing.cc @@ -17,8 +17,9 @@ #include "config.h" -#ifdef HAVE_SYS_RESOURCE_H +#if __has_include(<sys/resource.h>) #include <sys/resource.h> +#define HAVE_SYS_RESOURCE_H #endif #include <glib-unix.h> @@ -41,7 +41,7 @@ #include <errno.h> #include <fcntl.h> #include <limits.h> -#ifdef HAVE_SYS_SYSLIMITS_H +#if __has_include(<sys/syslimits.h>) #include <sys/syslimits.h> #endif #include <signal.h> @@ -51,14 +51,15 @@ #include <string.h> #include <termios.h> #include <unistd.h> -#ifdef HAVE_UTIL_H +#if __has_include(<util.h>) #include <util.h> #endif -#ifdef HAVE_PTY_H +#if __has_include(<pty.h>) #include <pty.h> #endif -#if defined(__sun) && defined(HAVE_STROPTS_H) +#if defined(__sun) && __has_include(<stropts.h>) #include <stropts.h> +#define HAVE_STROPTS_H #endif #include <glib.h> #include <gio/gio.h> @@ -27,10 +27,11 @@ #include <fcntl.h> #include <termios.h> -#ifdef HAVE_STROPTS_H +#if __has_include(<stropts.h>) #include <stropts.h> +#define HAVE_STROPTS_H #endif -#ifdef HAVE_SYS_STREAM_H +#if __has_include(<sys/stream.h>) #include <sys/stream.h> #endif @@ -54,14 +55,15 @@ #include "graphene-glue.hh" #endif -#ifdef HAVE_WCHAR_H +#if __has_include(<wchar.h>) #include <wchar.h> #endif -#ifdef HAVE_SYS_SYSLIMITS_H +#if __has_include(<sys/syslimits.h>) #include <sys/syslimits.h> #endif -#ifdef HAVE_SYS_WAIT_H +#if __has_include(<sys/wait.h>) #include <sys/wait.h> +#define HAVE_SYS_WAIT_H #endif #include <glib.h> #include <glib-object.h> diff --git a/src/vteaccess.cc b/src/vteaccess.cc index 302635a4..00bb1cd3 100644 --- a/src/vteaccess.cc +++ b/src/vteaccess.cc @@ -27,7 +27,7 @@ #include "vteinternal.hh" #include "widget.hh" -#ifdef HAVE_LOCALE_H +#if __has_include(<locale.h>) #include <locale.h> #endif #include <glib/gi18n-lib.h> diff --git a/src/vtegtk.cc b/src/vtegtk.cc index d4eeea4f..fa7856d9 100644 --- a/src/vtegtk.cc +++ b/src/vtegtk.cc @@ -37,7 +37,7 @@ #include <pwd.h> -#ifdef HAVE_LOCALE_H +#if __has_include(<locale.h>) #include <locale.h> #endif diff --git a/src/vteseq.cc b/src/vteseq.cc index 3945fcac..55315da6 100644 --- a/src/vteseq.cc +++ b/src/vteseq.cc @@ -23,7 +23,7 @@ #include <stdlib.h> #include <string.h> #include <limits.h> -#ifdef HAVE_SYS_SYSLIMITS_H +#if __has_include(<sys/syslimits.h>) #include <sys/syslimits.h> #endif |