mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-10-28 07:44:06 +01:00
Global (Android): fixes building on old API level
This commit is contained in:
@@ -598,7 +598,7 @@ const char* ffDexStaticInts(const char* jarPath, const FFDexStaticIntRequest* re
|
||||
[[gnu::cleanup(wrapDexMapping)]] FFDexMapping mapping = {};
|
||||
|
||||
{
|
||||
FF_AUTO_CLOSE_FD const int fd = open(jarPath, O_RDONLY | O_CLOEXEC);
|
||||
FF_AUTO_CLOSE_FD int fd = open(jarPath, O_RDONLY | O_CLOEXEC);
|
||||
if (fd < 0) {
|
||||
FF_DEBUG("open(%s) failed: %s", jarPath, strerror(errno));
|
||||
return "open(jar) failed";
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
|
||||
#if FF_HAVE_WORDEXP
|
||||
#include <wordexp.h>
|
||||
#else
|
||||
#elif FF_HAVE_GLOB
|
||||
#include <glob.h>
|
||||
#endif
|
||||
|
||||
@@ -112,7 +112,7 @@ bool ffPathExpandEnv(const char* in, FFstrbuf* out) {
|
||||
|
||||
wordfree(&exp);
|
||||
|
||||
#else
|
||||
#elif FF_HAVE_GLOB
|
||||
|
||||
glob_t gb;
|
||||
if (glob(in, GLOB_NOSORT
|
||||
@@ -134,6 +134,10 @@ bool ffPathExpandEnv(const char* in, FFstrbuf* out) {
|
||||
|
||||
globfree(&gb);
|
||||
|
||||
#else
|
||||
|
||||
FF_UNUSED(in, out)
|
||||
|
||||
#endif
|
||||
|
||||
return result;
|
||||
|
||||
@@ -6,8 +6,11 @@
|
||||
#include <string.h>
|
||||
|
||||
#if __ANDROID__ && !defined(FF_HAVE_EGL)
|
||||
// On Android, installing OpenGL headers is enough (mesa-dev)
|
||||
#if __has_include(<EGL/egl.h>)
|
||||
// On Android the EGL headers ship with the NDK, but the desktop GL ones only come from mesa-dev,
|
||||
// which a plain NDK build does not have. The block below includes <GL/gl.h>, so that is the
|
||||
// header to probe: probing <EGL/egl.h> turns this on for every NDK build and then fails to
|
||||
// compile. Termux installs mesa-dev, so it still gets the EGL path.
|
||||
#if __has_include(<EGL/egl.h>) && __has_include(<GL/gl.h>)
|
||||
#define FF_HAVE_EGL 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user