Added missing guards in implementation for PSP. Thanks to Martin Gerhardy for pointing this out.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227
diff --git a/src/audio/psp/SDL_pspaudio.c b/src/audio/psp/SDL_pspaudio.c
index 3abe3a1..3603911 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 <stdio.h>
#include <string.h>
#include <stdlib.h>
@@ -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 3f9bd2d..22bd6e9 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 <pspctrl.h>
#include <pspkernel.h>
@@ -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 d79135d..2ca8e44 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 <pspkernel.h>
@@ -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 1abd9a3..3959a4c 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 478575b..e1cf413 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 3abb835..609ba73 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 <stdio.h>
@@ -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 2d5433c..8cbd2f1 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 <stdio.h>
@@ -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 1ae3d7f..8488b28 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 982186b..399566b 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 8b2cd88..61620de 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 <stdlib.h>
#include <string.h>
@@ -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 d9d8eef..0c8f5a4 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 <stdio.h>
@@ -34,3 +35,7 @@
struct WMcursor {
int unused;
};
+
+#endif /* SDL_VIDEO_DRIVER_PSP */
+
+/* vi: set ts=4 sw=4 expandtab: */