equal
deleted
inserted
replaced
27 #include "SDL_fatal.h" |
27 #include "SDL_fatal.h" |
28 #include "SDL_assert.h" |
28 #include "SDL_assert.h" |
29 |
29 |
30 #if !SDL_VIDEO_DISABLED |
30 #if !SDL_VIDEO_DISABLED |
31 #include "video/SDL_leaks.h" |
31 #include "video/SDL_leaks.h" |
32 #endif |
|
33 |
|
34 #if SDL_THREAD_PTH |
|
35 #include <pth.h> |
|
36 #endif |
32 #endif |
37 |
33 |
38 /* Initialization/Cleanup routines */ |
34 /* Initialization/Cleanup routines */ |
39 #if !SDL_JOYSTICK_DISABLED |
35 #if !SDL_JOYSTICK_DISABLED |
40 extern int SDL_JoystickInit(void); |
36 extern int SDL_JoystickInit(void); |
150 } |
146 } |
151 |
147 |
152 int |
148 int |
153 SDL_Init(Uint32 flags) |
149 SDL_Init(Uint32 flags) |
154 { |
150 { |
155 #if !SDL_THREADS_DISABLED && SDL_THREAD_PTH |
|
156 if (!pth_init()) { |
|
157 return -1; |
|
158 } |
|
159 #endif |
|
160 |
|
161 if (SDL_AssertionsInit() < 0) { |
151 if (SDL_AssertionsInit() < 0) { |
162 return -1; |
152 return -1; |
163 } |
153 } |
164 |
154 |
165 /* Clear the error message */ |
155 /* Clear the error message */ |
264 /* Uninstall any parachute signal handlers */ |
254 /* Uninstall any parachute signal handlers */ |
265 SDL_UninstallParachute(); |
255 SDL_UninstallParachute(); |
266 |
256 |
267 SDL_AssertionsQuit(); |
257 SDL_AssertionsQuit(); |
268 |
258 |
269 #if !SDL_THREADS_DISABLED && SDL_THREAD_PTH |
|
270 pth_kill(); |
|
271 #endif |
|
272 #ifdef DEBUG_BUILD |
259 #ifdef DEBUG_BUILD |
273 printf("[SDL_Quit] : Returning!\n"); |
260 printf("[SDL_Quit] : Returning!\n"); |
274 fflush(stdout); |
261 fflush(stdout); |
275 #endif |
262 #endif |
276 |
263 |