Global: unifies FF_STR macro

This commit is contained in:
Carter Li
2026-06-13 08:25:59 +08:00
committed by 李通洲
parent 14dfe171fb
commit 17914dc29e
8 changed files with 9 additions and 20 deletions
+1 -2
View File
@@ -3,6 +3,7 @@
#include "common/parsing.h"
#include "common/thread.h"
#include "common/textModifier.h"
#include "common/strutil.h"
#include "detection/displayserver/displayserver.h"
#include "detection/terminaltheme/terminaltheme.h"
#include "logo/logo.h"
@@ -184,8 +185,6 @@ void ffDestroyInstance(void) {
#endif
#if FF_HAVE_QUICKJS
#include <quickjs.h>
#define FF_STR_INDIR(x) #x
#define FF_STR(x) FF_STR_INDIR(x)
#endif
// Must be in a file compiled with the libfastfetch target, because the FF_HAVE* macros are not defined for the executable targets
+1 -3
View File
@@ -1,12 +1,10 @@
#include "common/netif.h"
#include "common/io.h"
#include "common/strutil.h"
#include <net/if.h>
#include <stdio.h>
#define FF_STR_INDIR(x) #x
#define FF_STR(x) FF_STR_INDIR(x)
bool ffNetifGetDefaultRouteImplV4(FFNetifDefaultRouteResult* result) {
FILE* FF_AUTO_CLOSE_FILE netRoute = fopen("/proc/route", "r");
+3
View File
@@ -14,6 +14,9 @@ __stdcall char* StrStrIA(const char* lpFirst, const char* lpSrch);
#define strcasestr StrStrIA
#endif
#define FF_STR_INDIR(x) #x
#define FF_STR(x) FF_STR_INDIR(x)
static inline bool ffStrSet(const char* str) {
if (str == NULL) {
return false;
+1 -3
View File
@@ -2,6 +2,7 @@
#include "common/io.h"
#include "common/properties.h"
#include "common/memrchr.h"
#include "common/strutil.h"
#include <stdlib.h>
#ifdef __FreeBSD__
@@ -22,9 +23,6 @@
#include "fastfetch_amdgpuids.c.inc"
#endif
#define FF_STR_INDIR(x) #x
#define FF_STR(x) FF_STR_INDIR(x)
static const FFstrbuf* loadPciIds() {
static FFstrbuf pciids;
+1 -3
View File
@@ -1,7 +1,5 @@
#include "libc.h"
#define FF_STR_INDIR(x) #x
#define FF_STR(x) FF_STR_INDIR(x)
#include "common/strutil.h"
#include <features.h>
+1 -3
View File
@@ -1,7 +1,5 @@
#include "libc.h"
#define FF_STR_INDIR(x) #x
#define FF_STR(x) FF_STR_INDIR(x)
#include "common/strutil.h"
#include <features.h>
-3
View File
@@ -8,9 +8,6 @@
#include <string.h>
#include <stdlib.h>
#define FF_STR_INDIR(x) #x
#define FF_STR(x) FF_STR_INDIR(x)
static bool parseLsbRelease(const char* fileName, FFOSResult* result) {
return ffParsePropFileValues(fileName, 4, (FFpropquery[]) {
{ "DISTRIB_ID =", &result->id },
+1 -3
View File
@@ -1,4 +1,5 @@
#include "version.h"
#include "common/strutil.h"
#if defined(__x86_64__)
#define FF_ARCHITECTURE "x86_64"
@@ -62,9 +63,6 @@
#define FF_SYSNAME "Unknown"
#endif
#define FF_STR_INDIR(x) #x
#define FF_STR(x) FF_STR_INDIR(x)
FFVersionResult ffVersionResult = {
.projectName = FASTFETCH_PROJECT_NAME,
.sysName = FF_SYSNAME,