summaryrefslogtreecommitdiffstats
path: root/video/out/x11_common.c
diff options
context:
space:
mode:
authorStefano Pigozzi <stefano.pigozzi@gmail.com>2013-07-16 13:28:28 +0200
committerStefano Pigozzi <stefano.pigozzi@gmail.com>2013-11-03 21:59:54 +0100
commit37388ebb0ef9085c841d7f94e665a5a77cfe0e92 (patch)
treeb47d18bee4e7f661d9e6d794dac0ec1cebcd3a37 /video/out/x11_common.c
parent891a2a1f474add323145e6b2cd2d29181830e4a4 (diff)
downloadmpv-37388ebb0ef9085c841d7f94e665a5a77cfe0e92.tar.bz2
mpv-37388ebb0ef9085c841d7f94e665a5a77cfe0e92.tar.xz
configure: uniform the defines to #define HAVE_xxx (0|1)
The configure followed 5 different convetions of defines because the next guy always wanted to introduce a new better way to uniform it[1]. For an hypothetic feature 'hurr' you could have had: * #define HAVE_HURR 1 / #undef HAVE_DURR * #define HAVE_HURR / #undef HAVE_DURR * #define CONFIG_HURR 1 / #undef CONFIG_DURR * #define HAVE_HURR 1 / #define HAVE_DURR 0 * #define CONFIG_HURR 1 / #define CONFIG_DURR 0 All is now uniform and uses: * #define HAVE_HURR 1 * #define HAVE_DURR 0 We like definining to 0 as opposed to `undef` bcause it can help spot typos and is very helpful when doing big reorganizations in the code. [1]: http://xkcd.com/927/ related
Diffstat (limited to 'video/out/x11_common.c')
-rw-r--r--video/out/x11_common.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/video/out/x11_common.c b/video/out/x11_common.c
index 538235a439..54cd063505 100644
--- a/video/out/x11_common.c
+++ b/video/out/x11_common.c
@@ -46,27 +46,27 @@
#include <X11/keysym.h>
#include <X11/XKBlib.h>
-#ifdef CONFIG_XSS
+#if HAVE_XSS
#include <X11/extensions/scrnsaver.h>
#endif
-#ifdef CONFIG_XDPMS
+#if HAVE_XEXT
#include <X11/extensions/dpms.h>
#endif
-#ifdef CONFIG_XINERAMA
+#if HAVE_XINERAMA
#include <X11/extensions/Xinerama.h>
#endif
-#ifdef CONFIG_XF86VM
+#if HAVE_XF86VM
#include <X11/extensions/xf86vmode.h>
#endif
-#ifdef CONFIG_XF86XK
+#if HAVE_XF86XK
#include <X11/XF86keysym.h>
#endif
-#if CONFIG_ZLIB
+#if HAVE_ZLIB
#include <zlib.h>
#endif
@@ -424,7 +424,7 @@ static void vo_x11_update_screeninfo(struct vo *vo)
opts->screenwidth = x11->ws_width;
opts->screenheight = x11->ws_height;
}
-#ifdef CONFIG_XINERAMA
+#if HAVE_XINERAMA
if (opts->screen_id >= -1 && XineramaIsActive(x11->display) && !all_screens)
{
int screen = opts->fullscreen ? opts->fsscreen_id : opts->screen_id;
@@ -974,7 +974,7 @@ static void vo_x11_update_window_title(struct vo *vo)
vo_x11_set_property_utf8(vo, x11->XA_NET_WM_ICON_NAME, title);
}
-#if CONFIG_ZLIB
+#if HAVE_ZLIB
static bstr decompress_gz(bstr in)
{
bstr res = {0};
@@ -1530,7 +1530,7 @@ static void xscreensaver_heartbeat(struct vo_x11_state *x11)
static int xss_suspend(Display *mDisplay, Bool suspend)
{
-#ifndef CONFIG_XSS
+#if !HAVE_XSS
return 0;
#else
int event, error, major, minor;
@@ -1552,7 +1552,7 @@ static void saver_on(struct vo_x11_state *x11)
x11->screensaver_off = 0;
if (xss_suspend(mDisplay, False))
return;
-#ifdef CONFIG_XDPMS
+#if HAVE_XEXT
if (x11->dpms_disabled) {
int nothing;
if (DPMSQueryExtension(mDisplay, &nothing, &nothing)) {
@@ -1587,7 +1587,7 @@ static void saver_off(struct vo_x11_state *x11)
x11->screensaver_off = 1;
if (xss_suspend(mDisplay, True))
return;
-#ifdef CONFIG_XDPMS
+#if HAVE_XEXT
if (DPMSQueryExtension(mDisplay, &nothing, &nothing)) {
BOOL onoff;
CARD16 state;
@@ -1636,7 +1636,7 @@ static void vo_x11_selectinput_witherr(struct vo *vo,
}
}
-#ifdef CONFIG_XF86VM
+#if HAVE_XF86VM
double vo_x11_vm_get_fps(struct vo *vo)
{
struct vo_x11_state *x11 = vo->x11;
@@ -1648,7 +1648,7 @@ double vo_x11_vm_get_fps(struct vo *vo)
XFree(modeline.private);
return 1e3 * clock / modeline.htotal / modeline.vtotal;
}
-#else /* CONFIG_XF86VM */
+#else /* HAVE_XF86VM */
double vo_x11_vm_get_fps(struct vo *vo)
{
return 0;