Use `#ifdef` instead of `#if` when checking for HAVE_X11
#if HAVE_X11
causes errors on macOS clang, since HAVE_X11 is never defined in the CMakeLists.txt for APPLE
(see src/CMakeLists.txt).
Since it's only defined as -DHAVE_X11
there, this assumes there won't be a case where HAVE_X11
will be defined but false. I'm not sure why MSVC doesn't trip on this in the same way, but #ifdef
should work fine there too.
Edited by snow flurry