comparison src/main/win32/SDL_win32_main.c @ 1769:290b5baf2fca

Fixed bug #215 The current SVN trunk is missing the SDLCALL specifier at numerous locations. It has to be added for all (possibly user provided) callbacks. I stumbled over this while creating a makefile for the OpenWatcom compiler for Win32.
author Sam Lantinga <slouken@libsdl.org>
date Sun, 07 May 2006 03:40:06 +0000
parents 4aac8563c296
children 782fd950bd46 c121d94672cb 70e77cbba87c
comparison
equal deleted inserted replaced
1768:814f9f2c7a33 1769:290b5baf2fca
119 { 119 {
120 ShowError("Fatal Error", "Out of memory - aborting"); 120 ShowError("Fatal Error", "Out of memory - aborting");
121 return FALSE; 121 return FALSE;
122 } 122 }
123 123
124 /* SDL_Quit() shouldn't be used with atexit() directly because
125 calling conventions may differ... */
126 static void cleanup(void)
127 {
128 SDL_Quit();
129 }
130
124 /* Remove the output files if there was no output written */ 131 /* Remove the output files if there was no output written */
125 static void __cdecl cleanup_output(void) 132 static void cleanup_output(void)
126 { 133 {
127 #ifndef NO_STDIO_REDIRECT 134 #ifndef NO_STDIO_REDIRECT
128 FILE *file; 135 FILE *file;
129 int empty; 136 int empty;
130 #endif 137 #endif
186 193
187 bufp = SDL_stack_alloc(char, n+1); 194 bufp = SDL_stack_alloc(char, n+1);
188 if ( bufp == NULL ) { 195 if ( bufp == NULL ) {
189 return OutOfMemory(); 196 return OutOfMemory();
190 } 197 }
191 SDL_strlcpy(bufp, appname, n); 198 SDL_strlcpy(bufp, appname, n+1);
192 appname = bufp; 199 appname = bufp;
193 200
194 /* Load SDL dynamic link library */ 201 /* Load SDL dynamic link library */
195 if ( SDL_Init(SDL_INIT_NOPARACHUTE) < 0 ) { 202 if ( SDL_Init(SDL_INIT_NOPARACHUTE) < 0 ) {
196 ShowError("WinMain() error", SDL_GetError()); 203 ShowError("WinMain() error", SDL_GetError());
197 return(FALSE); 204 return(FALSE);
198 } 205 }
199 atexit(cleanup_output); 206 atexit(cleanup_output);
200 atexit(SDL_Quit); 207 atexit(cleanup);
201 208
202 /* Sam: 209 /* Sam:
203 We still need to pass in the application handle so that 210 We still need to pass in the application handle so that
204 DirectInput will initialize properly when SDL_RegisterApp() 211 DirectInput will initialize properly when SDL_RegisterApp()
205 is called later in the video initialization. 212 is called later in the video initialization.