Skip to content

Commit 2bf7184

Browse files
committed
Merge pull request #103865 from Repiteo/scons/__has_include
SCons: Remove `check_c_headers`
2 parents 796a08d + 007717f commit 2bf7184

File tree

4 files changed

+5
-16
lines changed

4 files changed

+5
-16
lines changed

SConstruct

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1156,15 +1156,6 @@ if env["vsproj"]:
11561156
env["CPPPATH"] = [Dir(path) for path in env["CPPPATH"]]
11571157
methods.generate_vs_project(env, ARGUMENTS, env["vsproj_name"])
11581158

1159-
# Check for the existence of headers
1160-
conf = Configure(env)
1161-
if "check_c_headers" in env:
1162-
headers = env["check_c_headers"]
1163-
for header in headers:
1164-
if conf.CheckCHeader(header):
1165-
env.AppendUnique(CPPDEFINES=[headers[header]])
1166-
conf.Finish()
1167-
11681159
# Miscellaneous & post-build methods.
11691160
if not env.GetOption("clean") and not env.GetOption("help"):
11701161
methods.dump(env)

drivers/unix/SCsub

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,5 +4,3 @@ from misc.utility.scons_hints import *
44
Import("env")
55

66
env.add_source_files(env.drivers_sources, "*.cpp")
7-
8-
env["check_c_headers"] = {"mntent.h": "HAVE_MNTENT"}

drivers/unix/dir_access_unix.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
#include <sys/stat.h>
4747
#include <sys/statvfs.h>
4848

49-
#ifdef HAVE_MNTENT
49+
#if __has_include(<mntent.h>)
5050
#include <mntent.h>
5151
#endif
5252

@@ -192,7 +192,7 @@ void DirAccessUnix::list_dir_end() {
192192
_cisdir = false;
193193
}
194194

195-
#if defined(HAVE_MNTENT) && defined(LINUXBSD_ENABLED)
195+
#if __has_include(<mntent.h>) && defined(LINUXBSD_ENABLED)
196196
static bool _filter_drive(struct mntent *mnt) {
197197
// Ignore devices that don't point to /dev
198198
if (strncmp(mnt->mnt_fsname, "/dev", 4) != 0) {
@@ -216,7 +216,7 @@ static void _get_drives(List<String> *list) {
216216
// Add root.
217217
list->push_back("/");
218218

219-
#if defined(HAVE_MNTENT) && defined(LINUXBSD_ENABLED)
219+
#if __has_include(<mntent.h>) && defined(LINUXBSD_ENABLED)
220220
// Check /etc/mtab for the list of mounted partitions.
221221
FILE *mtab = setmntent("/etc/mtab", "r");
222222
if (mtab) {

platform/linuxbsd/os_linuxbsd.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@
7676
#include <sys/utsname.h>
7777
#include <unistd.h>
7878

79-
#ifdef HAVE_MNTENT
79+
#if __has_include(<mntent.h>)
8080
#include <mntent.h>
8181
#endif
8282

@@ -999,7 +999,7 @@ static String get_mountpoint(const String &p_path) {
999999
return "";
10001000
}
10011001

1002-
#ifdef HAVE_MNTENT
1002+
#if __has_include(<mntent.h>)
10031003
dev_t dev = s.st_dev;
10041004
FILE *fd = setmntent("/proc/mounts", "r");
10051005
if (!fd) {

0 commit comments

Comments
 (0)