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:
李通洲
2022-09-29 14:22:56 +08:00
parent b8656d5e12
commit e7c9b80d85
3 changed files with 3 additions and 3 deletions
+2
View File
@@ -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
View File
@@ -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)