Android: fix compiling

This commit is contained in:
李通洲
2022-09-26 23:23:54 +08:00
parent d8bfebfc0f
commit 4632fe8cd9
3 changed files with 15 additions and 1 deletions
+5
View File
@@ -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()
+1
View File
@@ -1,3 +1,4 @@
#include "fastfetch.h"
#include "common/font.h"
const char* ffDetectFontImpl(FFinstance* instance, FFlist* result)
+9 -1
View File
@@ -1,7 +1,15 @@
#include "fastfetch.h"
#include "common/printing.h"
#include <utmpx.h>
#if FF_HAVE_UTMPX_H
#include <utmpx.h>
#else
//for Android compatibility
#include <utmp.h>
#define utmpx utmp
#define setutxent setutent
#define getutxent getutent
#endif
#define FF_USERS_MODULE_NAME "Users"
#define FF_USERS_NUM_FORMAT_ARGS 1