You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-04 12:00:25 +00:00
SCons: Remove check_c_headers
• Can instead check for headers directly with `__has_include`, a C++17 feature
This commit is contained in:
@@ -1156,15 +1156,6 @@ if env["vsproj"]:
|
|||||||
env["CPPPATH"] = [Dir(path) for path in env["CPPPATH"]]
|
env["CPPPATH"] = [Dir(path) for path in env["CPPPATH"]]
|
||||||
methods.generate_vs_project(env, ARGUMENTS, env["vsproj_name"])
|
methods.generate_vs_project(env, ARGUMENTS, env["vsproj_name"])
|
||||||
|
|
||||||
# Check for the existence of headers
|
|
||||||
conf = Configure(env)
|
|
||||||
if "check_c_headers" in env:
|
|
||||||
headers = env["check_c_headers"]
|
|
||||||
for header in headers:
|
|
||||||
if conf.CheckCHeader(header):
|
|
||||||
env.AppendUnique(CPPDEFINES=[headers[header]])
|
|
||||||
conf.Finish()
|
|
||||||
|
|
||||||
# Miscellaneous & post-build methods.
|
# Miscellaneous & post-build methods.
|
||||||
if not env.GetOption("clean") and not env.GetOption("help"):
|
if not env.GetOption("clean") and not env.GetOption("help"):
|
||||||
methods.dump(env)
|
methods.dump(env)
|
||||||
|
|||||||
@@ -4,5 +4,3 @@ from misc.utility.scons_hints import *
|
|||||||
Import("env")
|
Import("env")
|
||||||
|
|
||||||
env.add_source_files(env.drivers_sources, "*.cpp")
|
env.add_source_files(env.drivers_sources, "*.cpp")
|
||||||
|
|
||||||
env["check_c_headers"] = {"mntent.h": "HAVE_MNTENT"}
|
|
||||||
|
|||||||
@@ -46,7 +46,7 @@
|
|||||||
#include <sys/stat.h>
|
#include <sys/stat.h>
|
||||||
#include <sys/statvfs.h>
|
#include <sys/statvfs.h>
|
||||||
|
|
||||||
#ifdef HAVE_MNTENT
|
#if __has_include(<mntent.h>)
|
||||||
#include <mntent.h>
|
#include <mntent.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -192,7 +192,7 @@ void DirAccessUnix::list_dir_end() {
|
|||||||
_cisdir = false;
|
_cisdir = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(HAVE_MNTENT) && defined(LINUXBSD_ENABLED)
|
#if __has_include(<mntent.h>) && defined(LINUXBSD_ENABLED)
|
||||||
static bool _filter_drive(struct mntent *mnt) {
|
static bool _filter_drive(struct mntent *mnt) {
|
||||||
// Ignore devices that don't point to /dev
|
// Ignore devices that don't point to /dev
|
||||||
if (strncmp(mnt->mnt_fsname, "/dev", 4) != 0) {
|
if (strncmp(mnt->mnt_fsname, "/dev", 4) != 0) {
|
||||||
@@ -216,7 +216,7 @@ static void _get_drives(List<String> *list) {
|
|||||||
// Add root.
|
// Add root.
|
||||||
list->push_back("/");
|
list->push_back("/");
|
||||||
|
|
||||||
#if defined(HAVE_MNTENT) && defined(LINUXBSD_ENABLED)
|
#if __has_include(<mntent.h>) && defined(LINUXBSD_ENABLED)
|
||||||
// Check /etc/mtab for the list of mounted partitions.
|
// Check /etc/mtab for the list of mounted partitions.
|
||||||
FILE *mtab = setmntent("/etc/mtab", "r");
|
FILE *mtab = setmntent("/etc/mtab", "r");
|
||||||
if (mtab) {
|
if (mtab) {
|
||||||
|
|||||||
@@ -76,7 +76,7 @@
|
|||||||
#include <sys/utsname.h>
|
#include <sys/utsname.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
|
|
||||||
#ifdef HAVE_MNTENT
|
#if __has_include(<mntent.h>)
|
||||||
#include <mntent.h>
|
#include <mntent.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
@@ -999,7 +999,7 @@ static String get_mountpoint(const String &p_path) {
|
|||||||
return "";
|
return "";
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef HAVE_MNTENT
|
#if __has_include(<mntent.h>)
|
||||||
dev_t dev = s.st_dev;
|
dev_t dev = s.st_dev;
|
||||||
FILE *fd = setmntent("/proc/mounts", "r");
|
FILE *fd = setmntent("/proc/mounts", "r");
|
||||||
if (!fd) {
|
if (!fd) {
|
||||||
|
|||||||
Reference in New Issue
Block a user