Skip to content

Commit

Permalink
x11window_xlib: Disable XShm on Android
Browse files Browse the repository at this point in the history
  • Loading branch information
LekKit committed Oct 8, 2024
1 parent b2000b9 commit d9e9fdc
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/devices/x11window_xlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,18 @@ along with this program. If not, see <https://www.gnu.org/licenses/>.
// Resolve symbols at runtime
#define X11_DLIB_SYM(sym) static typeof(sym)* sym##_dlib = NULL;

// Check for X11 headers presence
#if defined(USE_X11) && !(CHECK_INCLUDE(X11/Xlib.h, 1) && CHECK_INCLUDE(X11/Xutil.h, 1) && CHECK_INCLUDE(X11/keysym.h, 1))
#if !(CHECK_INCLUDE(X11/Xlib.h, 1) && CHECK_INCLUDE(X11/Xutil.h, 1) && CHECK_INCLUDE(X11/keysym.h, 1))
// No X11 headers found
#undef USE_X11
#warning Disabling X11 support as <X11/Xlib.h> is unavailable
#endif

// Check for XShm header presence
#if CHECK_INCLUDE(X11/extensions/XShm.h, 1) && CHECK_INCLUDE(sys/ipc.h, 1) && CHECK_INCLUDE(sys/shm.h, 1)
#define USE_XSHM
#else
#elif defined(__ANDROID__)
// There's no SysV SHM on Android
#warning Disabling XShm support on Android
#elif !(CHECK_INCLUDE(X11/extensions/XShm.h, 1) && CHECK_INCLUDE(sys/ipc.h, 1) && CHECK_INCLUDE(sys/shm.h, 1))
// No XShm headers found
#warning Disabling XShm support as <X11/extensions/XShm.h> is unavailable
#else
#define USE_XSHM
#endif

#ifdef USE_X11
Expand Down

0 comments on commit d9e9fdc

Please sign in to comment.