[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v2 01/10] sdl: move version logic from source code t
From: |
Gerd Hoffmann |
Subject: |
[Qemu-devel] [PATCH v2 01/10] sdl: move version logic from source code to makefile |
Date: |
Tue, 16 Dec 2014 14:26:13 +0100 |
Compile sdl.c / sdl2.c depending on CONFIG_SDLABI instead of
compiling both and have version #ifdefs in the source code.
Signed-off-by: Gerd Hoffmann <address@hidden>
Reviewed-by: Max Reitz <address@hidden>
---
ui/Makefile.objs | 7 ++++++-
ui/sdl.c | 3 ---
ui/sdl2.c | 3 ---
3 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/ui/Makefile.objs b/ui/Makefile.objs
index 801cba2..b25e85f 100644
--- a/ui/Makefile.objs
+++ b/ui/Makefile.objs
@@ -16,7 +16,12 @@ common-obj-$(CONFIG_CURSES) += curses.o
common-obj-$(CONFIG_VNC) += $(vnc-obj-y)
common-obj-$(CONFIG_GTK) += gtk.o x_keymap.o
-sdl.mo-objs := sdl.o sdl_zoom.o sdl2.o
+ifeq ($(CONFIG_SDLABI),1.2)
+sdl.mo-objs := sdl.o sdl_zoom.o
+endif
+ifeq ($(CONFIG_SDLABI),2.0)
+sdl.mo-objs := sdl2.o
+endif
sdl.mo-cflags := $(SDL_CFLAGS)
gtk.o-cflags := $(GTK_CFLAGS) $(VTE_CFLAGS)
diff --git a/ui/sdl.c b/ui/sdl.c
index 94c1d9d..3e9d810 100644
--- a/ui/sdl.c
+++ b/ui/sdl.c
@@ -26,8 +26,6 @@
#undef WIN32_LEAN_AND_MEAN
#include <SDL.h>
-
-#if SDL_MAJOR_VERSION == 1
#include <SDL_syswm.h>
#include "qemu-common.h"
@@ -958,4 +956,3 @@ void sdl_display_init(DisplayState *ds, int full_screen,
int no_frame)
atexit(sdl_cleanup);
}
-#endif
diff --git a/ui/sdl2.c b/ui/sdl2.c
index 1ad74ba..45f23b1 100644
--- a/ui/sdl2.c
+++ b/ui/sdl2.c
@@ -27,8 +27,6 @@
#undef WIN32_LEAN_AND_MEAN
#include <SDL.h>
-
-#if SDL_MAJOR_VERSION == 2
#include <SDL_syswm.h>
#include "qemu-common.h"
@@ -912,4 +910,3 @@ void sdl_display_init(DisplayState *ds, int full_screen,
int no_frame)
atexit(sdl_cleanup);
}
-#endif
--
1.8.3.1
- [Qemu-devel] [PATCH v2 00/10] sdl2: fixes, cleanups and opengl preparation., Gerd Hoffmann, 2014/12/16
- [Qemu-devel] [PATCH v2 04/10] sdl2: turn on keyboard grabs, Gerd Hoffmann, 2014/12/16
- [Qemu-devel] [PATCH v2 03/10] sdl2: move keyboard input code to new sdl2-input.c, Gerd Hoffmann, 2014/12/16
- [Qemu-devel] [PATCH v2 02/10] sdl2: rename sdl2_state to sdl2_console, move to header file, Gerd Hoffmann, 2014/12/16
- [Qemu-devel] [PATCH v2 08/10] sdl2: add+use sdl2_2d_redraw function., Gerd Hoffmann, 2014/12/16
- [Qemu-devel] [PATCH v2 06/10] sdl2: overhaul window size handling, Gerd Hoffmann, 2014/12/16
- [Qemu-devel] [PATCH v2 09/10] sdl2: factor out sdl2_poll_events, Gerd Hoffmann, 2014/12/16
- [Qemu-devel] [PATCH v2 05/10] sdl2: move sdl_update to new sdl2-2d.c, Gerd Hoffmann, 2014/12/16
- [Qemu-devel] [PATCH v2 01/10] sdl: move version logic from source code to makefile,
Gerd Hoffmann <=
- [Qemu-devel] [PATCH v2 10/10] sdl2: move sdl2_2d_refresh to sdl2-2d.c, Gerd Hoffmann, 2014/12/16
- [Qemu-devel] [PATCH v2 07/10] sdl2: move sdl_switch to sdl2-2d.c, Gerd Hoffmann, 2014/12/16