From 86f87bf7554036fac0490a264786fb2226f01369 Mon Sep 17 00:00:00 2001 From: Philipp Wiesemann Date: Sat, 31 Jan 2015 22:45:54 +0100 Subject: [PATCH] Added missing guards in implementation for PSP. Thanks to Martin Gerhardy for pointing this out. --- src/audio/psp/SDL_pspaudio.c | 5 ++++- src/joystick/psp/SDL_sysjoystick.c | 4 ++++ src/main/psp/SDL_psp_main.c | 7 +++++++ src/thread/psp/SDL_syscond.c | 4 ++++ src/thread/psp/SDL_sysmutex.c | 4 ++++ src/thread/psp/SDL_syssem.c | 4 ++++ src/thread/psp/SDL_systhread.c | 4 ++++ src/timer/psp/SDL_systimer.c | 4 ++++ src/video/psp/SDL_pspevents.c | 5 +++++ src/video/psp/SDL_pspgl.c | 5 +++++ src/video/psp/SDL_pspmouse.c | 5 +++++ 11 files changed, 50 insertions(+), 1 deletion(-) diff --git a/src/audio/psp/SDL_pspaudio.c b/src/audio/psp/SDL_pspaudio.c index 3abe3a110..360391164 100644 --- a/src/audio/psp/SDL_pspaudio.c +++ b/src/audio/psp/SDL_pspaudio.c @@ -20,6 +20,8 @@ */ #include "../../SDL_internal.h" +#if SDL_AUDIO_DRIVER_PSP + #include #include #include @@ -192,5 +194,6 @@ AudioBootStrap PSPAUD_bootstrap = { /* SDL_AUDI */ +#endif /* SDL_AUDIO_DRIVER_PSP */ - +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/joystick/psp/SDL_sysjoystick.c b/src/joystick/psp/SDL_sysjoystick.c index 3f9bd2d92..22bd6e9de 100644 --- a/src/joystick/psp/SDL_sysjoystick.c +++ b/src/joystick/psp/SDL_sysjoystick.c @@ -20,6 +20,8 @@ */ #include "../../SDL_internal.h" +#if SDL_JOYSTICK_PSP + /* This is the PSP implementation of the SDL joystick API */ #include #include @@ -263,5 +265,7 @@ SDL_JoystickGUID SDL_SYS_JoystickGetGUID(SDL_Joystick * joystick) return guid; } +#endif /* SDL_JOYSTICK_PSP */ + /* vim: ts=4 sw=4 */ diff --git a/src/main/psp/SDL_psp_main.c b/src/main/psp/SDL_psp_main.c index d79135dbc..2ca8e446b 100644 --- a/src/main/psp/SDL_psp_main.c +++ b/src/main/psp/SDL_psp_main.c @@ -1,6 +1,9 @@ /* SDL_psp_main.c, placed in the public domain by Sam Lantinga 3/13/14 */ +#include "SDL_config.h" + +#ifdef __PSP__ #include "SDL_main.h" #include @@ -61,3 +64,7 @@ int main(int argc, char *argv[]) (void)SDL_main(argc, argv); return 0; } + +#endif /* __PSP__ */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/psp/SDL_syscond.c b/src/thread/psp/SDL_syscond.c index 1abd9a3d9..3959a4c43 100644 --- a/src/thread/psp/SDL_syscond.c +++ b/src/thread/psp/SDL_syscond.c @@ -20,6 +20,8 @@ */ #include "../../SDL_internal.h" +#if SDL_THREAD_PSP + /* An implementation of condition variables using semaphores and mutexes */ /* This implementation borrows heavily from the BeOS condition variable @@ -217,4 +219,6 @@ SDL_CondWait(SDL_cond * cond, SDL_mutex * mutex) return SDL_CondWaitTimeout(cond, mutex, SDL_MUTEX_MAXWAIT); } +#endif /* SDL_THREAD_PSP */ + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/psp/SDL_sysmutex.c b/src/thread/psp/SDL_sysmutex.c index 478575b32..e1cf413c3 100644 --- a/src/thread/psp/SDL_sysmutex.c +++ b/src/thread/psp/SDL_sysmutex.c @@ -20,6 +20,8 @@ */ #include "../../SDL_internal.h" +#if SDL_THREAD_PSP + /* An implementation of mutexes using semaphores */ #include "SDL_thread.h" @@ -129,4 +131,6 @@ SDL_mutexV(SDL_mutex * mutex) #endif /* SDL_THREADS_DISABLED */ } +#endif /* SDL_THREAD_PSP */ + /* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/thread/psp/SDL_syssem.c b/src/thread/psp/SDL_syssem.c index 3abb83565..609ba7375 100644 --- a/src/thread/psp/SDL_syssem.c +++ b/src/thread/psp/SDL_syssem.c @@ -20,6 +20,8 @@ */ #include "../../SDL_internal.h" +#if SDL_THREAD_PSP + /* Semaphore functions for the PSP. */ #include @@ -153,5 +155,7 @@ int SDL_SemPost(SDL_sem *sem) return 0; } +#endif /* SDL_THREAD_PSP */ + /* vim: ts=4 sw=4 */ diff --git a/src/thread/psp/SDL_systhread.c b/src/thread/psp/SDL_systhread.c index 2d5433c53..8cbd2f132 100644 --- a/src/thread/psp/SDL_systhread.c +++ b/src/thread/psp/SDL_systhread.c @@ -20,6 +20,8 @@ */ #include "../../SDL_internal.h" +#if SDL_THREAD_PSP + /* PSP thread management routines for SDL */ #include @@ -104,5 +106,7 @@ int SDL_SYS_SetThreadPriority(SDL_ThreadPriority priority) } +#endif /* SDL_THREAD_PSP */ + /* vim: ts=4 sw=4 */ diff --git a/src/timer/psp/SDL_systimer.c b/src/timer/psp/SDL_systimer.c index 1ae3d7fe5..8488b284d 100644 --- a/src/timer/psp/SDL_systimer.c +++ b/src/timer/psp/SDL_systimer.c @@ -20,6 +20,8 @@ */ #include "../../SDL_internal.h" +#ifdef SDL_TIMERS_PSP + #include "SDL_thread.h" #include "SDL_timer.h" #include "SDL_error.h" @@ -83,5 +85,7 @@ void SDL_Delay(Uint32 ms) sceKernelDelayThreadCB(ms * 1000); } +#endif /* SDL_TIMERS_PSP */ + /* vim: ts=4 sw=4 */ diff --git a/src/video/psp/SDL_pspevents.c b/src/video/psp/SDL_pspevents.c index 982186b47..399566bf6 100644 --- a/src/video/psp/SDL_pspevents.c +++ b/src/video/psp/SDL_pspevents.c @@ -20,6 +20,8 @@ */ #include "../../SDL_internal.h" +#if SDL_VIDEO_DRIVER_PSP + /* Being a null driver, there's no event stream. We just define stubs for most of the API. */ @@ -283,3 +285,6 @@ void PSP_EventQuit(_THIS) /* end of SDL_pspevents.c ... */ +#endif /* SDL_VIDEO_DRIVER_PSP */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/psp/SDL_pspgl.c b/src/video/psp/SDL_pspgl.c index 8b2cd8865..61620de38 100644 --- a/src/video/psp/SDL_pspgl.c +++ b/src/video/psp/SDL_pspgl.c @@ -20,6 +20,8 @@ */ #include "../../SDL_internal.h" +#if SDL_VIDEO_DRIVER_PSP + #include #include @@ -204,3 +206,6 @@ PSP_GL_DeleteContext(_THIS, SDL_GLContext context) return; } +#endif /* SDL_VIDEO_DRIVER_PSP */ + +/* vi: set ts=4 sw=4 expandtab: */ diff --git a/src/video/psp/SDL_pspmouse.c b/src/video/psp/SDL_pspmouse.c index d9d8eefd2..0c8f5a428 100644 --- a/src/video/psp/SDL_pspmouse.c +++ b/src/video/psp/SDL_pspmouse.c @@ -20,6 +20,7 @@ */ #include "../../SDL_internal.h" +#if SDL_VIDEO_DRIVER_PSP #include @@ -34,3 +35,7 @@ struct WMcursor { int unused; }; + +#endif /* SDL_VIDEO_DRIVER_PSP */ + +/* vi: set ts=4 sw=4 expandtab: */