mirror of
https://github.com/FWGS/xash3d-fwgs.git
synced 2026-08-07 04:40:43 +08:00
filesystem: wscript: check d_type field in struct dirent, as this is an extension and some supported ports (like psvita) don't have it
This commit is contained in:
@@ -4,6 +4,11 @@ MEMFD_CREATE_TEST = '''#define _GNU_SOURCE
|
||||
#include <sys/mman.h>
|
||||
int main(int argc, char **argv) { return memfd_create(argv[0], 0); }'''
|
||||
|
||||
DIRENT_D_TYPE_TEST = '''#define _GNU_SOURCE
|
||||
#include <dirent.h>
|
||||
int main(int argc, char **argv) { struct dirent entry; entry.d_type = DT_DIR; return 0; }
|
||||
'''
|
||||
|
||||
def options(opt):
|
||||
pass
|
||||
|
||||
@@ -18,6 +23,9 @@ def configure(conf):
|
||||
if conf.check_cc(fragment=MEMFD_CREATE_TEST, msg='Checking for memfd_create', mandatory=False):
|
||||
conf.define('HAVE_MEMFD_CREATE', 1)
|
||||
|
||||
if conf.check_cc(fragment=DIRENT_D_TYPE_TEST, msg='Checking for d_type field in struct dirent', mandatory=False):
|
||||
conf.define('HAVE_DIRENT_D_TYPE', 1)
|
||||
|
||||
def build(bld):
|
||||
bld(name = 'filesystem_includes', export_includes = '.')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user