Fixed bug 1419 - SDL_libgl2D.c breaks ndk-build
authorSam Lantinga <slouken@libsdl.org>
Wed, 15 Feb 2012 21:11:21 -0500
changeset 6291 d88e5195dee3
parent 6290 4cf8e87aff95
child 6292 4c25a7b9e819
Fixed bug 1419 - SDL_libgl2D.c breaks ndk-build Philip Taylor 2012-02-15 10:43:47 PST render/nds/SDL_libgl2D.c unconditionally includes NDS-only code. SDL's Android.mk compiles source files matching $(wildcard $(LOCAL_PATH)/src/render/*/*.c) which includes that file, causing build errors when running ndk-build.
src/render/nds/SDL_libgl2D.c
src/render/nds/SDL_libgl2D.h
--- a/src/render/nds/SDL_libgl2D.c	Wed Feb 15 21:06:45 2012 -0500
+++ b/src/render/nds/SDL_libgl2D.c	Wed Feb 15 21:11:21 2012 -0500
@@ -13,6 +13,9 @@
  *
  *	A very small and simple DS rendering lib using the 3d core to render 2D stuff
  */
+#include "SDL_config.h"
+
+#if SDL_VIDEO_RENDER_NDS
 
 #include "SDL_libgl2D.h"
 
@@ -308,3 +311,5 @@
 	glPopMatrix(1);
 	g_depth++;
 }
+
+#endif /* SDL_VIDEO_RENDER_NDS */
--- a/src/render/nds/SDL_libgl2D.h	Wed Feb 15 21:06:45 2012 -0500
+++ b/src/render/nds/SDL_libgl2D.h	Wed Feb 15 21:11:21 2012 -0500
@@ -13,6 +13,9 @@
  *
  *	A very small and simple DS rendering lib using the 3d core to render 2D stuff
  */
+#include "SDL_config.h"
+
+#if SDL_VIDEO_RENDER_NDS
 
 #include <nds/arm9/videoGL.h>
 
@@ -148,3 +151,4 @@
  */
 void glBoxFilled(int x1, int y1, int x2, int y2, int color);
 
+#endif /* SDL_VIDEO_RENDER_NDS */