Properly check for mkdir on Windows

We have to include direct.h
This commit is contained in:
Luca Bacci 2026-03-27 18:37:52 +01:00
parent a63d15a577
commit 75ca66c31d
3 changed files with 6 additions and 9 deletions

View file

@ -1,8 +1,9 @@
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_IO_H
#include <io.h>
#ifdef _WIN32
#define _CRT_NONSTDC_NO_WARNINGS
#include <direct.h>
#endif
int main(int ac, char **av)

View file

@ -1,8 +1,9 @@
#ifdef HAVE_SYS_STAT_H
#include <sys/stat.h>
#endif
#ifdef HAVE_IO_H
#include <io.h>
#ifdef _WIN32
#define _CRT_NONSTDC_NO_WARNINGS
#include <direct.h>
#endif
int main(int ac, char **av)

View file

@ -142,7 +142,6 @@ check_headers = [
['fenv.h'],
['sys/wait.h'],
['sys/stat.h'],
['io.h'],
['fenv.h', {'check-funcs': ['feenableexcept', 'fedisableexcept', 'feclearexcept']}],
['xlocale.h'],
['sys/ioctl.h'],
@ -798,10 +797,6 @@ if conf.get('HAVE_SYS_STAT_H', 0) == 1
test_mkdir_c_args += ['-DHAVE_SYS_STAT_H']
endif
if conf.get('HAVE_IO_H', 0) == 1
test_mkdir_c_args += ['-DHAVE_IO_H']
endif
if cc.links(files('meson-cc-tests/mkdir-variant-1.c'), args: test_mkdir_c_args)
conf.set('HAVE_MKDIR', 1)
elif cc.links(files('meson-cc-tests/mkdir-variant-2.c'), args: test_mkdir_c_args)