Global: don't use __has_include

It reports false results in ubuntu 20.04. Details unknown.
This commit is contained in:
李通洲
2024-07-30 11:06:27 +08:00
parent 4371e719ae
commit ec8391f6c6
8 changed files with 81 additions and 57 deletions
+11 -17
View File
@@ -7,29 +7,23 @@
#include "common/properties.h"
#include "util/stringUtils.h"
#define FF_STR_INDIR(x) #x
#define FF_STR(x) FF_STR_INDIR(x)
#include <inttypes.h>
#if __has_include(<drm/drm.h>)
#include <drm/drm.h>
#define FF_HAVE_DRM_H 1
#elif __has_include(<libdrm/drm.h>)
#include <libdrm/drm.h>
#define FF_HAVE_DRM_H 1
#endif
#if FF_HAVE_DRM_H
#include <fcntl.h>
#include <sys/ioctl.h>
#if __aarch64__ && __has_include(<drm/asahi_drm.h>)
#include <drm/asahi_drm.h>
#if __aarch64__
#if __has_include(<asahi_drm.h>)
#include <asahi_drm.h>
#include <drm.h>
#include <fcntl.h>
#include <sys/ioctl.h>
#define FF_HAVE_ASAHI_DRM_H 1
#else
#warning "<asahi_drm.h> not available"
#endif
#endif
#define FF_STR_INDIR(x) #x
#define FF_STR(x) FF_STR_INDIR(x)
static bool pciDetectDriver(FFGPUResult* gpu, FFstrbuf* pciDir, FFstrbuf* buffer, FF_MAYBE_UNUSED const char* drmKey)
{
uint32_t pciDirLength = pciDir->length;