feat(3p/nix): meson: Define HAVE_STRUCT_DIRENT_D_TYPE macro
(cherry picked from commit 7ae66bbef5e92f4a0bba49780d8c316f134884f2)
This commit is contained in:
parent
55e9f61041
commit
d64f60c733
1 changed files with 20 additions and 2 deletions
22
third_party/nix/meson.build
vendored
22
third_party/nix/meson.build
vendored
|
@ -163,7 +163,8 @@ if (cpp.has_header('sys/ndir.h'))
|
||||||
description : 'Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR`')
|
description : 'Define to 1 if you have the <sys/ndir.h> header file, and it defines `DIR`')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
if (cpp.has_header('dirent.h'))
|
has_dirent_h = cpp.has_header('dirent.h')
|
||||||
|
if (has_dirent_h)
|
||||||
config_h.set(
|
config_h.set(
|
||||||
'HAVE_DIRENT_H', 1,
|
'HAVE_DIRENT_H', 1,
|
||||||
description : 'Define to 1 if you have the <dirent.h> header file, and it defines `DIR`')
|
description : 'Define to 1 if you have the <dirent.h> header file, and it defines `DIR`')
|
||||||
|
@ -309,6 +310,23 @@ if meson.get_compiler('cpp').compiles(
|
||||||
description : 'Define to 1 if you have the `pubsetbuf` function.')
|
description : 'Define to 1 if you have the `pubsetbuf` function.')
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
# checking data types
|
||||||
|
#============================================================================
|
||||||
|
|
||||||
|
|
||||||
|
dirent_h_prefix = '''
|
||||||
|
#include <sys/types.h>
|
||||||
|
#include <dirent.h>
|
||||||
|
'''
|
||||||
|
|
||||||
|
# Code taken from glib, thanks!
|
||||||
|
if has_dirent_h and meson.get_compiler('cpp').has_member('struct dirent', 'd_type', prefix: dirent_h_prefix)
|
||||||
|
define = 'HAVE_STRUCT_@0@_@1@'.format('dirent'.to_upper(), 'd_type'.underscorify().to_upper())
|
||||||
|
config_h.set(define, 1)
|
||||||
|
endif
|
||||||
|
|
||||||
# required dependancies
|
# required dependancies
|
||||||
#============================================================================
|
#============================================================================
|
||||||
|
|
||||||
|
@ -552,4 +570,4 @@ project_dirs = [
|
||||||
|
|
||||||
foreach dir : project_dirs
|
foreach dir : project_dirs
|
||||||
subdir(dir)
|
subdir(dir)
|
||||||
endforeach
|
endforeach
|
||||||
|
|
Loading…
Reference in a new issue