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
+2 -2
View File
@@ -5,13 +5,13 @@
#include <fcntl.h>
#include <sys/ioctl.h>
#if __has_include(<linux/videodev2.h>)
#if FF_HAVE_LINUX_VIDEODEV2
#include <linux/videodev2.h>
#endif
const char* ffDetectCamera(FFlist* result)
{
#if __has_include(<linux/videodev2.h>)
#if FF_HAVE_LINUX_VIDEODEV2
char path[] = "/dev/videoN";
for (uint32_t i = 0; i <= 9; ++i)
+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;
+1 -1
View File
@@ -1,7 +1,7 @@
#include "fastfetch.h"
#include "users.h"
#if __has_include(<utmpx.h>)
#if FF_HAVE_UTMPX
#include <utmpx.h>
#else
//for Android compatibility
+1 -1
View File
@@ -212,7 +212,7 @@ static const char* detectWifiWithLibnm(FFlist* result)
#endif
#if __has_include(<linux/wireless.h>)
#if FF_HAVE_LINUX_WIRELESS
#define FF_DETECT_WIFI_WITH_IOCTLS
#include "common/io/io.h"