From e278d0551cda4dbd3d9e9cbb929a75cb4a5828c8 Mon Sep 17 00:00:00 2001 From: Thomas Bernard Date: Sat, 9 Feb 2019 15:46:33 +0100 Subject: [PATCH] fix build with GP2XCROSS --- src/Makefile | 3 ++- src/input.c | 2 ++ src/screen.h | 3 +++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/Makefile b/src/Makefile index 835e0036..69ab53f4 100644 --- a/src/Makefile +++ b/src/Makefile @@ -508,7 +508,8 @@ endif CC = /opt/open2x/gcc-4.1.1-glibc-2.3.6/bin/arm-open2x-linux-gcc BIN = ../bin/grafx2.gpe SDLCONFIG = /opt/open2x/gcc-4.1.1-glibc-2.3.6/bin/sdl-config - COPT = -W -Wall -Wdeclaration-after-statement -pedantic -std=c99 -static -g -O$(OPTIM) + COPT = -W -Wall -Wdeclaration-after-statement -std=c99 -static -g -O$(OPTIM) + COPT += -D_XOPEN_SOURCE=500 COPT += -I/opt/open2x/gcc-4.1.1-glibc-2.3.6/include COPT += $(shell $(SDLCONFIG) --cflags) COPT += -D__GP2X__ $(TTFCOPT) $(JOYCOPT) $(LUACOPT) diff --git a/src/input.c b/src/input.c index d7270845..9696fa09 100644 --- a/src/input.c +++ b/src/input.c @@ -24,8 +24,10 @@ #include #if defined(USE_SDL) || defined(USE_SDL2) #include +#if (defined(SDL_VIDEO_DRIVER_X11) && !defined(NO_X11)) || defined(__WIN32__) #include #endif +#endif #ifdef WIN32 #include diff --git a/src/screen.h b/src/screen.h index 344d3c08..9542aa81 100644 --- a/src/screen.h +++ b/src/screen.h @@ -33,8 +33,11 @@ #include // for HWND #endif #if defined(USE_SDL) || defined(USE_SDL2) +#include +#if defined(SDL_VIDEO_DRIVER_X11) #include // for Display, Window #endif +#endif #if defined(USE_X11) #include // for Display, Window #endif