intel/perf: adapt to platforms like Solaris without d_type in struct dirent

Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
[Eric: factor out the is_dir_or_link() check and fix a bug in v1]
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
v3: include directory path when lstat'ing files
v4: fix inverted check in enumerate_sysfs_metrics()

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Tested-by: Marge Bot <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2258>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/2258>
This commit is contained in:
Alan Coopersmith
2019-11-05 16:56:46 -08:00
committed by Marge Bot
parent 8f140422ed
commit 8490b7d917
2 changed files with 25 additions and 5 deletions

View File

@@ -1178,6 +1178,11 @@ if host_machine.system() != 'windows'
endif
endif
if cc.has_member('struct dirent', 'd_type', prefix: '''#include <sys/types.h>
#include <dirent.h>''')
pre_args += '-DHAVE_DIRENT_D_TYPE'
endif
# strtod locale support
if cc.links('''
#define _GNU_SOURCE