#include "visual.h"
#include <string.h>
+#ifndef HAVE_ANDROID
#include <X11/Xutil.h>
+#else
+#include "../android/android-visual.h"
+#endif
extern char *progname;
-
#ifndef isupper
# define isupper(c) ((c) >= 'A' && (c) <= 'Z')
#endif
int ndepths = 0;
int *depths = XListDepths (dpy, screen_number (screen), &ndepths);
- int screen_depth = depths[ndepths];
+ int screen_depth = (depths && ndepths) ? depths[ndepths - 1] : 0;
XFree (depths);
vi_in.class = TrueColor;