mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-29 16:26:39 +01:00
Fix building on Linux
It seems that glibc doesn't support strnstr, and strcasestr requires _GNU_SOURCE to be defined
This commit is contained in:
@@ -333,6 +333,8 @@ add_library(libfastfetch OBJECT
|
||||
${LIBFASTFETCH_SRC}
|
||||
)
|
||||
|
||||
target_compile_definitions(libfastfetch PUBLIC _GNU_SOURCE)
|
||||
|
||||
CHECK_INCLUDE_FILE("sys/sysinfo.h" HAVE_SYSINFO_H)
|
||||
if(HAVE_SYSINFO_H)
|
||||
# needs to be public, because changes fastfech.h ABI
|
||||
|
||||
@@ -1,5 +1,3 @@
|
||||
#define _GNU_SOURCE //required for struct ucred
|
||||
|
||||
#include "displayserver_linux.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
|
||||
+1
-1
@@ -159,7 +159,7 @@ static inline FF_C_NODISCARD int ffStrbufIgnCaseComp(const FFstrbuf* strbuf, con
|
||||
|
||||
static inline FF_C_NODISCARD bool ffStrbufContainS(const FFstrbuf* strbuf, const char* str)
|
||||
{
|
||||
return strnstr(strbuf->chars, str, strbuf->length) != NULL;
|
||||
return strstr(strbuf->chars, str) != NULL;
|
||||
}
|
||||
|
||||
static inline FF_C_NODISCARD bool ffStrbufContainIgnCaseS(const FFstrbuf* strbuf, const char* str)
|
||||
|
||||
Reference in New Issue
Block a user