diff --git a/CMakeLists.txt b/CMakeLists.txt index f28620b3c..6e98032b2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -338,6 +338,11 @@ if(HAVE_SYSINFO_H) target_compile_definitions(libfastfetch PUBLIC FF_HAVE_SYSINFO_H) endif() +CHECK_INCLUDE_FILE("utmpx.h" HAVE_UTMPX_H) +if(HAVE_UTMPX_H) + target_compile_definitions(libfastfetch PRIVATE FF_HAVE_UTMPX_H) +endif() + function(ff_lib_enable VARNAME) if(NOT ENABLE_${VARNAME}) return() diff --git a/src/detection/font/font_android.c b/src/detection/font/font_android.c index 1719c7511..3f8578b81 100644 --- a/src/detection/font/font_android.c +++ b/src/detection/font/font_android.c @@ -1,3 +1,4 @@ +#include "fastfetch.h" #include "common/font.h" const char* ffDetectFontImpl(FFinstance* instance, FFlist* result) diff --git a/src/modules/users.c b/src/modules/users.c index 880b14c35..ec1265338 100644 --- a/src/modules/users.c +++ b/src/modules/users.c @@ -1,7 +1,15 @@ #include "fastfetch.h" #include "common/printing.h" -#include +#if FF_HAVE_UTMPX_H + #include +#else + //for Android compatibility + #include + #define utmpx utmp + #define setutxent setutent + #define getutxent getutent +#endif #define FF_USERS_MODULE_NAME "Users" #define FF_USERS_NUM_FORMAT_ARGS 1