diff options
Diffstat (limited to 'apps/plugins/sdl/progs/wolf3d')
-rw-r--r-- | apps/plugins/sdl/progs/wolf3d/sdl_winmain.c | 378 | ||||
-rw-r--r-- | apps/plugins/sdl/progs/wolf3d/wl_def.h | 26 | ||||
-rw-r--r-- | apps/plugins/sdl/progs/wolf3d/wl_main.c | 25 | ||||
-rw-r--r-- | apps/plugins/sdl/progs/wolf3d/wl_menu.c | 6 |
4 files changed, 11 insertions, 424 deletions
diff --git a/apps/plugins/sdl/progs/wolf3d/sdl_winmain.c b/apps/plugins/sdl/progs/wolf3d/sdl_winmain.c deleted file mode 100644 index 366616d5ff..0000000000 --- a/apps/plugins/sdl/progs/wolf3d/sdl_winmain.c +++ /dev/null | |||
@@ -1,378 +0,0 @@ | |||
1 | #ifdef _WIN32 | ||
2 | |||
3 | /* | ||
4 | SDL_main.c, placed in the public domain by Sam Lantinga 4/13/98 | ||
5 | |||
6 | Modified to write stdout/stderr to a message box at shutdown by Ripper 2007-12-27 | ||
7 | |||
8 | The WinMain function -- calls your program's main() function | ||
9 | */ | ||
10 | |||
11 | #include <stdio.h> | ||
12 | #include <stdlib.h> | ||
13 | |||
14 | #define WIN32_LEAN_AND_MEAN | ||
15 | #include <windows.h> | ||
16 | |||
17 | #ifdef _WIN32_WCE | ||
18 | # define DIR_SEPERATOR TEXT("\\") | ||
19 | # undef _getcwd | ||
20 | # define _getcwd(str,len) wcscpy(str,TEXT("")) | ||
21 | # define setbuf(f,b) | ||
22 | # define setvbuf(w,x,y,z) | ||
23 | # define fopen _wfopen | ||
24 | # define freopen _wfreopen | ||
25 | # define remove(x) DeleteFile(x) | ||
26 | #else | ||
27 | # define DIR_SEPERATOR TEXT("/") | ||
28 | # include <direct.h> | ||
29 | #endif | ||
30 | |||
31 | /* Include the SDL main definition header */ | ||
32 | #include "SDL.h" | ||
33 | #include "SDL_main.h" | ||
34 | |||
35 | #ifdef main | ||
36 | # ifndef _WIN32_WCE_EMULATION | ||
37 | # undef main | ||
38 | # endif /* _WIN32_WCE_EMULATION */ | ||
39 | #endif /* main */ | ||
40 | |||
41 | /* The standard output files */ | ||
42 | #define STDOUT_FILE TEXT("stdout.txt") | ||
43 | #define STDERR_FILE TEXT("stderr.txt") | ||
44 | |||
45 | #ifndef NO_STDIO_REDIRECT | ||
46 | # ifdef _WIN32_WCE | ||
47 | static wchar_t stdoutPath[MAX_PATH]; | ||
48 | static wchar_t stderrPath[MAX_PATH]; | ||
49 | # else | ||
50 | static char stdoutPath[MAX_PATH]; | ||
51 | static char stderrPath[MAX_PATH]; | ||
52 | # endif | ||
53 | #endif | ||
54 | |||
55 | #if defined(_WIN32_WCE) && _WIN32_WCE < 300 | ||
56 | /* seems to be undefined in Win CE although in online help */ | ||
57 | #define isspace(a) (((CHAR)a == ' ') || ((CHAR)a == '\t')) | ||
58 | #endif /* _WIN32_WCE < 300 */ | ||
59 | |||
60 | /* Parse a command line buffer into arguments */ | ||
61 | static int ParseCommandLine(char *cmdline, char **argv) | ||
62 | { | ||
63 | char *bufp; | ||
64 | int argc; | ||
65 | |||
66 | argc = 0; | ||
67 | for ( bufp = cmdline; *bufp; ) { | ||
68 | /* Skip leading whitespace */ | ||
69 | while ( isspace(*bufp) ) { | ||
70 | ++bufp; | ||
71 | } | ||
72 | /* Skip over argument */ | ||
73 | if ( *bufp == '"' ) { | ||
74 | ++bufp; | ||
75 | if ( *bufp ) { | ||
76 | if ( argv ) { | ||
77 | argv[argc] = bufp; | ||
78 | } | ||
79 | ++argc; | ||
80 | } | ||
81 | /* Skip over word */ | ||
82 | while ( *bufp && (*bufp != '"') ) { | ||
83 | ++bufp; | ||
84 | } | ||
85 | } else { | ||
86 | if ( *bufp ) { | ||
87 | if ( argv ) { | ||
88 | argv[argc] = bufp; | ||
89 | } | ||
90 | ++argc; | ||
91 | } | ||
92 | /* Skip over word */ | ||
93 | while ( *bufp && ! isspace(*bufp) ) { | ||
94 | ++bufp; | ||
95 | } | ||
96 | } | ||
97 | if ( *bufp ) { | ||
98 | if ( argv ) { | ||
99 | *bufp = '\0'; | ||
100 | } | ||
101 | ++bufp; | ||
102 | } | ||
103 | } | ||
104 | if ( argv ) { | ||
105 | argv[argc] = NULL; | ||
106 | } | ||
107 | return(argc); | ||
108 | } | ||
109 | |||
110 | /* Show an error message */ | ||
111 | static void ShowError(const char *title, const char *message) | ||
112 | { | ||
113 | /* If USE_MESSAGEBOX is defined, you need to link with user32.lib */ | ||
114 | #ifdef USE_MESSAGEBOX | ||
115 | MessageBox(NULL, message, title, MB_ICONEXCLAMATION|MB_OK); | ||
116 | #else | ||
117 | fprintf(stderr, "%s: %s\n", title, message); | ||
118 | #endif | ||
119 | } | ||
120 | |||
121 | /* Pop up an out of memory message, returns to Windows */ | ||
122 | static bool OutOfMemory(void) | ||
123 | { | ||
124 | ShowError("Fatal Error", "Out of memory - aborting"); | ||
125 | return FALSE; | ||
126 | } | ||
127 | |||
128 | /* SDL_Quit() shouldn't be used with atexit() directly because | ||
129 | calling conventions may differ... */ | ||
130 | static void cleanup(void) | ||
131 | { | ||
132 | SDL_Quit(); | ||
133 | } | ||
134 | |||
135 | /* Remove the output files if there was no output written */ | ||
136 | static void cleanup_output(void) | ||
137 | { | ||
138 | #if 1 | ||
139 | #ifndef NO_STDIO_REDIRECT | ||
140 | FILE *file; | ||
141 | #endif | ||
142 | #endif | ||
143 | |||
144 | /* Flush the output in case anything is queued */ | ||
145 | fclose(stdout); | ||
146 | fclose(stderr); | ||
147 | |||
148 | #if 1 | ||
149 | #ifndef NO_STDIO_REDIRECT | ||
150 | /* See if the files have any output in them */ | ||
151 | if ( stdoutPath[0] ) { | ||
152 | file = fopen(stdoutPath, TEXT("r")); | ||
153 | if ( file ) { | ||
154 | char buf[16384]; | ||
155 | size_t readbytes = fread(buf, 1, 16383, file); | ||
156 | fclose(file); | ||
157 | |||
158 | if(readbytes != 0) | ||
159 | { | ||
160 | buf[readbytes] = 0; // cut after last byte (<=16383) | ||
161 | MessageBox(NULL, buf, "Wolf4SDL", MB_OK); | ||
162 | } | ||
163 | else | ||
164 | remove(stdoutPath); // remove empty file | ||
165 | } | ||
166 | } | ||
167 | if ( stderrPath[0] ) { | ||
168 | file = fopen(stderrPath, TEXT("rb")); | ||
169 | if ( file ) { | ||
170 | char buf[16384]; | ||
171 | size_t readbytes = fread(buf, 1, 16383, file); | ||
172 | fclose(file); | ||
173 | |||
174 | if(readbytes != 0) | ||
175 | { | ||
176 | buf[readbytes] = 0; // cut after last byte (<=16383) | ||
177 | MessageBox(NULL, buf, "Wolf4SDL", MB_OK); | ||
178 | } | ||
179 | else | ||
180 | remove(stderrPath); // remove empty file | ||
181 | } | ||
182 | } | ||
183 | #endif | ||
184 | #endif | ||
185 | } | ||
186 | |||
187 | //#if defined(_MSC_VER) && !defined(_WIN32_WCE) | ||
188 | ///* The VC++ compiler needs main defined */ | ||
189 | //#define console_main main | ||
190 | //#endif | ||
191 | |||
192 | /* This is where execution begins [console apps] */ | ||
193 | int console_main(int argc, char *argv[]) | ||
194 | { | ||
195 | size_t n; | ||
196 | char *bufp, *appname; | ||
197 | int status; | ||
198 | |||
199 | /* Get the class name from argv[0] */ | ||
200 | appname = argv[0]; | ||
201 | if ( (bufp=SDL_strrchr(argv[0], '\\')) != NULL ) { | ||
202 | appname = bufp+1; | ||
203 | } else | ||
204 | if ( (bufp=SDL_strrchr(argv[0], '/')) != NULL ) { | ||
205 | appname = bufp+1; | ||
206 | } | ||
207 | |||
208 | if ( (bufp=SDL_strrchr(appname, '.')) == NULL ) | ||
209 | n = SDL_strlen(appname); | ||
210 | else | ||
211 | n = (bufp-appname); | ||
212 | |||
213 | bufp = SDL_stack_alloc(char, n+1); | ||
214 | if ( bufp == NULL ) { | ||
215 | return OutOfMemory(); | ||
216 | } | ||
217 | SDL_strlcpy(bufp, appname, n+1); | ||
218 | appname = bufp; | ||
219 | |||
220 | /* Load SDL dynamic link library */ | ||
221 | if ( SDL_Init(SDL_INIT_NOPARACHUTE) < 0 ) { | ||
222 | ShowError("WinMain() error", SDL_GetError()); | ||
223 | return(FALSE); | ||
224 | } | ||
225 | atexit(cleanup_output); | ||
226 | atexit(cleanup); | ||
227 | |||
228 | /* Sam: | ||
229 | We still need to pass in the application handle so that | ||
230 | DirectInput will initialize properly when SDL_RegisterApp() | ||
231 | is called later in the video initialization. | ||
232 | */ | ||
233 | SDL_SetModuleHandle(GetModuleHandle(NULL)); | ||
234 | |||
235 | /* Run the application main() code */ | ||
236 | status = SDL_main(argc, argv); | ||
237 | |||
238 | /* Exit cleanly, calling atexit() functions */ | ||
239 | exit(status); | ||
240 | |||
241 | /* Hush little compiler, don't you cry... */ | ||
242 | return 0; | ||
243 | } | ||
244 | |||
245 | /* This is where execution begins [windowed apps] */ | ||
246 | #ifdef _WIN32_WCE | ||
247 | int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPWSTR szCmdLine, int sw) | ||
248 | #else | ||
249 | int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw) | ||
250 | #endif | ||
251 | { | ||
252 | HINSTANCE handle; | ||
253 | char **argv; | ||
254 | int argc; | ||
255 | char *cmdline; | ||
256 | #ifdef _WIN32_WCE | ||
257 | wchar_t *bufp; | ||
258 | int nLen; | ||
259 | #else | ||
260 | char *bufp; | ||
261 | size_t nLen; | ||
262 | #endif | ||
263 | #ifndef NO_STDIO_REDIRECT | ||
264 | DWORD pathlen; | ||
265 | #ifdef _WIN32_WCE | ||
266 | wchar_t path[MAX_PATH]; | ||
267 | #else | ||
268 | char path[MAX_PATH]; | ||
269 | #endif | ||
270 | FILE *newfp; | ||
271 | #endif | ||
272 | |||
273 | /* Start up DDHELP.EXE before opening any files, so DDHELP doesn't | ||
274 | keep them open. This is a hack.. hopefully it will be fixed | ||
275 | someday. DDHELP.EXE starts up the first time DDRAW.DLL is loaded. | ||
276 | */ | ||
277 | handle = LoadLibrary(TEXT("DDRAW.DLL")); | ||
278 | if ( handle != NULL ) { | ||
279 | FreeLibrary(handle); | ||
280 | } | ||
281 | |||
282 | #ifndef NO_STDIO_REDIRECT | ||
283 | pathlen = GetModuleFileName(NULL, path, SDL_arraysize(path)); | ||
284 | while ( pathlen > 0 && path[pathlen] != '\\' ) { | ||
285 | --pathlen; | ||
286 | } | ||
287 | path[pathlen] = '\0'; | ||
288 | |||
289 | #ifdef _WIN32_WCE | ||
290 | wcsncpy( stdoutPath, path, SDL_arraysize(stdoutPath) ); | ||
291 | wcsncat( stdoutPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath) ); | ||
292 | #else | ||
293 | SDL_strlcpy( stdoutPath, path, SDL_arraysize(stdoutPath) ); | ||
294 | SDL_strlcat( stdoutPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath) ); | ||
295 | #endif | ||
296 | |||
297 | /* Redirect standard input and standard output */ | ||
298 | newfp = freopen(stdoutPath, TEXT("w"), stdout); | ||
299 | |||
300 | #ifndef _WIN32_WCE | ||
301 | if ( newfp == NULL ) { /* This happens on NT */ | ||
302 | #if !defined(stdout) | ||
303 | stdout = fopen(stdoutPath, TEXT("w")); | ||
304 | #else | ||
305 | newfp = fopen(stdoutPath, TEXT("w")); | ||
306 | if ( newfp ) { | ||
307 | *stdout = *newfp; | ||
308 | } | ||
309 | #endif | ||
310 | } | ||
311 | #endif /* _WIN32_WCE */ | ||
312 | |||
313 | #ifdef _WIN32_WCE | ||
314 | wcsncpy( stderrPath, path, SDL_arraysize(stdoutPath) ); | ||
315 | wcsncat( stderrPath, DIR_SEPERATOR STDOUT_FILE, SDL_arraysize(stdoutPath) ); | ||
316 | #else | ||
317 | SDL_strlcpy( stderrPath, path, SDL_arraysize(stderrPath) ); | ||
318 | SDL_strlcat( stderrPath, DIR_SEPERATOR STDERR_FILE, SDL_arraysize(stderrPath) ); | ||
319 | #endif | ||
320 | |||
321 | newfp = freopen(stderrPath, TEXT("w"), stderr); | ||
322 | #ifndef _WIN32_WCE | ||
323 | if ( newfp == NULL ) { /* This happens on NT */ | ||
324 | #if !defined(stderr) | ||
325 | stderr = fopen(stderrPath, TEXT("w")); | ||
326 | #else | ||
327 | newfp = fopen(stderrPath, TEXT("w")); | ||
328 | if ( newfp ) { | ||
329 | *stderr = *newfp; | ||
330 | } | ||
331 | #endif | ||
332 | } | ||
333 | #endif /* _WIN32_WCE */ | ||
334 | |||
335 | setvbuf(stdout, NULL, _IOLBF, BUFSIZ); /* Line buffered */ | ||
336 | setbuf(stderr, NULL); /* No buffering */ | ||
337 | #endif /* !NO_STDIO_REDIRECT */ | ||
338 | |||
339 | #ifdef _WIN32_WCE | ||
340 | nLen = wcslen(szCmdLine)+128+1; | ||
341 | bufp = SDL_stack_alloc(wchar_t, nLen*2); | ||
342 | wcscpy (bufp, TEXT("\"")); | ||
343 | GetModuleFileName(NULL, bufp+1, 128-3); | ||
344 | wcscpy (bufp+wcslen(bufp), TEXT("\" ")); | ||
345 | wcsncpy(bufp+wcslen(bufp), szCmdLine,nLen-wcslen(bufp)); | ||
346 | nLen = wcslen(bufp)+1; | ||
347 | cmdline = SDL_stack_alloc(char, nLen); | ||
348 | if ( cmdline == NULL ) { | ||
349 | return OutOfMemory(); | ||
350 | } | ||
351 | WideCharToMultiByte(CP_ACP, 0, bufp, -1, cmdline, nLen, NULL, NULL); | ||
352 | #else | ||
353 | /* Grab the command line */ | ||
354 | bufp = GetCommandLine(); | ||
355 | nLen = SDL_strlen(bufp)+1; | ||
356 | cmdline = SDL_stack_alloc(char, nLen); | ||
357 | if ( cmdline == NULL ) { | ||
358 | return OutOfMemory(); | ||
359 | } | ||
360 | SDL_strlcpy(cmdline, bufp, nLen); | ||
361 | #endif | ||
362 | |||
363 | /* Parse it into argv and argc */ | ||
364 | argc = ParseCommandLine(cmdline, NULL); | ||
365 | argv = SDL_stack_alloc(char*, argc+1); | ||
366 | if ( argv == NULL ) { | ||
367 | return OutOfMemory(); | ||
368 | } | ||
369 | ParseCommandLine(cmdline, argv); | ||
370 | |||
371 | /* Run the main program (after a little SDL initialization) */ | ||
372 | console_main(argc, argv); | ||
373 | |||
374 | /* Hush little compiler, don't you cry... */ | ||
375 | return 0; | ||
376 | } | ||
377 | |||
378 | #endif // _WIN32 | ||
diff --git a/apps/plugins/sdl/progs/wolf3d/wl_def.h b/apps/plugins/sdl/progs/wolf3d/wl_def.h index 1b8670ffb6..13ec77cf70 100644 --- a/apps/plugins/sdl/progs/wolf3d/wl_def.h +++ b/apps/plugins/sdl/progs/wolf3d/wl_def.h | |||
@@ -1392,23 +1392,17 @@ static fixed FixedMul(fixed a, fixed b) | |||
1392 | 1392 | ||
1393 | #define CHECKMALLOCRESULT(x) if(!(x)) Quit("Out of memory at %s:%i", __FILE__, __LINE__) | 1393 | #define CHECKMALLOCRESULT(x) if(!(x)) Quit("Out of memory at %s:%i", __FILE__, __LINE__) |
1394 | 1394 | ||
1395 | #ifdef _WIN32 | 1395 | static char* itoa(int value, char* string, int radix) |
1396 | #define strcasecmp stricmp | 1396 | { |
1397 | #define strncasecmp strnicmp | 1397 | sprintf(string, "%d", value); |
1398 | #define snprintf _snprintf | 1398 | return string; |
1399 | #else | 1399 | } |
1400 | static char* itoa(int value, char* string, int radix) | ||
1401 | { | ||
1402 | sprintf(string, "%d", value); | ||
1403 | return string; | ||
1404 | } | ||
1405 | 1400 | ||
1406 | static char* ltoa(long value, char* string, int radix) | 1401 | static char* ltoa(long value, char* string, int radix) |
1407 | { | 1402 | { |
1408 | sprintf(string, "%ld", value); | 1403 | sprintf(string, "%ld", value); |
1409 | return string; | 1404 | return string; |
1410 | } | 1405 | } |
1411 | #endif | ||
1412 | 1406 | ||
1413 | #define lengthof(x) (sizeof(x) / sizeof(*(x))) | 1407 | #define lengthof(x) (sizeof(x) / sizeof(*(x))) |
1414 | #define endof(x) ((x) + lengthof(x)) | 1408 | #define endof(x) ((x) + lengthof(x)) |
diff --git a/apps/plugins/sdl/progs/wolf3d/wl_main.c b/apps/plugins/sdl/progs/wolf3d/wl_main.c index 634196498a..8808cd0883 100644 --- a/apps/plugins/sdl/progs/wolf3d/wl_main.c +++ b/apps/plugins/sdl/progs/wolf3d/wl_main.c | |||
@@ -1191,9 +1191,6 @@ static void InitGame() | |||
1191 | #endif | 1191 | #endif |
1192 | 1192 | ||
1193 | // initialize SDL | 1193 | // initialize SDL |
1194 | #if defined _WIN32 | ||
1195 | putenv("SDL_VIDEODRIVER=directx"); | ||
1196 | #endif | ||
1197 | if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) | 1194 | if(SDL_Init(SDL_INIT_VIDEO | SDL_INIT_AUDIO) < 0) |
1198 | { | 1195 | { |
1199 | printf("Unable to init SDL: %s\n", SDL_GetError()); | 1196 | printf("Unable to init SDL: %s\n", SDL_GetError()); |
@@ -1217,23 +1214,7 @@ static void InitGame() | |||
1217 | #endif | 1214 | #endif |
1218 | 1215 | ||
1219 | SignonScreen (); | 1216 | SignonScreen (); |
1220 | 1217 | ||
1221 | #if defined _WIN32 | ||
1222 | if(!fullscreen) | ||
1223 | { | ||
1224 | struct SDL_SysWMinfo wmInfo; | ||
1225 | SDL_VERSION(&wmInfo.version); | ||
1226 | |||
1227 | if(SDL_GetWMInfo(&wmInfo) != -1) | ||
1228 | { | ||
1229 | HWND hwndSDL = wmInfo.window; | ||
1230 | DWORD style = GetWindowLong(hwndSDL, GWL_STYLE) & ~WS_SYSMENU; | ||
1231 | SetWindowLong(hwndSDL, GWL_STYLE, style); | ||
1232 | SetWindowPos(hwndSDL, NULL, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE | SWP_NOZORDER | SWP_FRAMECHANGED); | ||
1233 | } | ||
1234 | } | ||
1235 | #endif | ||
1236 | |||
1237 | VH_Startup (); | 1218 | VH_Startup (); |
1238 | IN_Startup (); | 1219 | IN_Startup (); |
1239 | PM_Startup (); | 1220 | PM_Startup (); |
@@ -1911,11 +1892,7 @@ void CheckParameters(int argc, char *argv[]) | |||
1911 | " --ignorenumchunks Ignores the number of chunks in VGAHEAD.*\n" | 1892 | " --ignorenumchunks Ignores the number of chunks in VGAHEAD.*\n" |
1912 | " (may be useful for some broken mods)\n" | 1893 | " (may be useful for some broken mods)\n" |
1913 | " --configdir <dir> Directory where config file and save games are stored\n" | 1894 | " --configdir <dir> Directory where config file and save games are stored\n" |
1914 | #if defined(_arch_dreamcast) || defined(_WIN32) | ||
1915 | " (default: current directory)\n" | ||
1916 | #else | ||
1917 | " (default: $HOME/.wolf4sdl)\n" | 1895 | " (default: $HOME/.wolf4sdl)\n" |
1918 | #endif | ||
1919 | #if defined(SPEAR) && !defined(SPEARDEMO) | 1896 | #if defined(SPEAR) && !defined(SPEARDEMO) |
1920 | " --mission <mission> Mission number to play (0-3)\n" | 1897 | " --mission <mission> Mission number to play (0-3)\n" |
1921 | " (default: 0 -> .sod, 1-3 -> .sd*)\n" | 1898 | " (default: 0 -> .sod, 1-3 -> .sd*)\n" |
diff --git a/apps/plugins/sdl/progs/wolf3d/wl_menu.c b/apps/plugins/sdl/progs/wolf3d/wl_menu.c index d72f0733c2..cdbc70aad1 100644 --- a/apps/plugins/sdl/progs/wolf3d/wl_menu.c +++ b/apps/plugins/sdl/progs/wolf3d/wl_menu.c | |||
@@ -3992,7 +3992,6 @@ CheckForEpisodes (void) | |||
3992 | int statbuf; | 3992 | int statbuf; |
3993 | 3993 | ||
3994 | // On Linux like systems, the configdir defaults to $HOME/.wolf4sdl | 3994 | // On Linux like systems, the configdir defaults to $HOME/.wolf4sdl |
3995 | #if !defined(_WIN32) && !defined(_arch_dreamcast) | ||
3996 | if(configdir[0] == 0) | 3995 | if(configdir[0] == 0) |
3997 | { | 3996 | { |
3998 | // Set config location to home directory for multi-user support | 3997 | // Set config location to home directory for multi-user support |
@@ -4008,18 +4007,13 @@ CheckForEpisodes (void) | |||
4008 | } | 4007 | } |
4009 | snprintf(configdir, sizeof(configdir), "%s" WOLFDIR, homedir); | 4008 | snprintf(configdir, sizeof(configdir), "%s" WOLFDIR, homedir); |
4010 | } | 4009 | } |
4011 | #endif | ||
4012 | 4010 | ||
4013 | if(configdir[0] != 0) | 4011 | if(configdir[0] != 0) |
4014 | { | 4012 | { |
4015 | // Ensure config directory exists and create if necessary | 4013 | // Ensure config directory exists and create if necessary |
4016 | if(stat(configdir, &statbuf) != 0) | 4014 | if(stat(configdir, &statbuf) != 0) |
4017 | { | 4015 | { |
4018 | #ifdef _WIN32 | ||
4019 | if(_mkdir(configdir) != 0) | ||
4020 | #else | ||
4021 | if(mkdir(configdir) != 0) | 4016 | if(mkdir(configdir) != 0) |
4022 | #endif | ||
4023 | { | 4017 | { |
4024 | Quit("The configuration directory \"%s\" could not be created.", configdir); | 4018 | Quit("The configuration directory \"%s\" could not be created.", configdir); |
4025 | } | 4019 | } |