File tree Expand file tree Collapse file tree 3 files changed +25
-7
lines changed Expand file tree Collapse file tree 3 files changed +25
-7
lines changed Original file line number Diff line number Diff line change @@ -630,11 +630,6 @@ if(WIN32)
630
630
target_compile_definitions (libfastfetch PUBLIC WIN32_LEAN_AND_MEAN=1 )
631
631
endif ()
632
632
633
- CHECK_INCLUDE_FILE ("utmpx.h" HAVE_UTMPX_H )
634
- if (HAVE_UTMPX_H )
635
- target_compile_definitions (libfastfetch PRIVATE FF_HAVE_UTMPX_H )
636
- endif ()
637
-
638
633
if (HAVE_WCWIDTH )
639
634
target_compile_definitions (libfastfetch PRIVATE FF_HAVE_WCWIDTH )
640
635
endif ()
@@ -829,6 +824,20 @@ elseif(BSD)
829
824
target_link_libraries (libfastfetch
830
825
PRIVATE "usbhid"
831
826
)
827
+ elseif (ANDROID )
828
+ CHECK_LIBRARY_EXISTS (-l:libandroid-wordexp.a wordexp "" HAVE_LIBANDROID_WORDEXP_STATIC )
829
+ if (HAVE_LIBANDROID_WORDEXP_STATIC )
830
+ target_link_libraries (libfastfetch
831
+ PRIVATE -l:libandroid-wordexp.a
832
+ )
833
+ else ()
834
+ CHECK_LIBRARY_EXISTS (android-wordexp wordexp "" HAVE_LIBANDROID_WORDEXP )
835
+ if (HAVE_LIBANDROID_WORDEXP )
836
+ target_link_libraries (libfastfetch
837
+ PRIVATE android-wordexp
838
+ )
839
+ endif ()
840
+ endif ()
832
841
endif ()
833
842
834
843
target_include_directories (libfastfetch
Original file line number Diff line number Diff line change 1
1
#include "io.h"
2
2
#include "util/stringUtils.h"
3
+ #include "util/unused.h"
3
4
4
5
#include <fcntl.h>
5
6
#include <sys/stat.h>
6
7
#include <termios.h>
7
8
#include <poll.h>
8
9
#include <dirent.h>
10
+
11
+ #if __has_include (< wordexp .h > )
9
12
#include <wordexp.h>
13
+ #endif
10
14
11
15
static void createSubfolders (const char * fileName )
12
16
{
@@ -108,9 +112,12 @@ bool ffPathExists(const char* path, FFPathType type)
108
112
return false;
109
113
}
110
114
111
- bool ffPathExpandEnv (const char * in , FFstrbuf * out )
115
+ bool ffPathExpandEnv (FF_MAYBE_UNUSED const char * in , FF_MAYBE_UNUSED FFstrbuf * out )
112
116
{
113
117
bool result = false;
118
+
119
+ #if __has_include (< wordexp .h > ) // https://github.com/termux/termux-packages/pull/7056
120
+
114
121
wordexp_t exp ;
115
122
if (wordexp (in , & exp , WRDE_NOCMD ) != 0 )
116
123
return false;
@@ -123,6 +130,8 @@ bool ffPathExpandEnv(const char* in, FFstrbuf* out)
123
130
124
131
wordfree (& exp );
125
132
133
+ #endif
134
+
126
135
return result ;
127
136
}
128
137
Original file line number Diff line number Diff line change 1
1
#include "fastfetch.h"
2
2
#include "users.h"
3
3
4
- #if FF_HAVE_UTMPX_H
4
+ #if __has_include ( < utmpx . h > )
5
5
#include <utmpx.h>
6
6
#else
7
7
//for Android compatibility
You can’t perform that action at this time.
0 commit comments