Commit ef1df3f8 authored by Sam Lantinga's avatar Sam Lantinga

Updated for Visual Studio Express 2005

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%401427
parent 14c0a481
No preview for this file type
......@@ -25,6 +25,7 @@
#ifndef _SDL_H
#define _SDL_H
#include "SDL_main.h"
#include "SDL_stdinc.h"
#include "SDL_audio.h"
#include "SDL_cdrom.h"
......
......@@ -50,7 +50,6 @@
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_AHI 1
#define SDL_AUDIO_DRIVER_DISK 1
/* Enable various cdrom drivers */
#define SDL_CDROM_DUMMY 1
......@@ -69,7 +68,6 @@
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_CYBERGRAPHICS 1
#define SDL_VIDEO_DRIVER_DUMMY 1
/* Enable OpenGL support */
#define SDL_VIDEO_OPENGL 1
......
......@@ -52,7 +52,6 @@
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_DC 1
#define SDL_AUDIO_DRIVER_DISK 1
/* Enable various cdrom drivers */
#define SDL_CDROM_DC 1
......@@ -71,6 +70,5 @@
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DC 1
#define SDL_VIDEO_DRIVER_DUMMY 1
#endif /* _SDL_config_dreamcast_h */
......@@ -51,7 +51,6 @@
#define HAVE_MEMCMP 1
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_SNDMGR 1
/* Enable various cdrom drivers */
......@@ -71,7 +70,6 @@
/* Enable various video drivers */
#define SDL_VIDEO_DRIVER_DRAWSPROCKET 1
#define SDL_VIDEO_DRIVER_DUMMY 1
#define SDL_VIDEO_DRIVER_TOOLBOX 1
/* Enable OpenGL support */
......
......@@ -52,7 +52,6 @@
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_COREAUDIO 1
#define SDL_AUDIO_DRIVER_DISK 1
#define SDL_AUDIO_DRIVER_SNDMGR 1
/* Enable various cdrom drivers */
......
......@@ -25,15 +25,23 @@
/* This is a set of defines to configure the SDL features */
#ifdef _MSC_VER
typedef __int8 int8_t;
typedef unsigned __int8 uint8_t;
typedef __int16 int16_t;
typedef unsigned __int16 uint16_t;
typedef __int32 int32_t;
typedef unsigned __int32 uint32_t;
typedef __int64 int64_t;
typedef unsigned __int64 uint64_t;
#endif
#define SDL_HAS_64BIT_TYPE 1
/* Useful headers */
#define HAVE_STDARG_H 1
#define HAVE_STDDEF_H 1
#define HAVE_INTTYPES_H 1
/* Enable various audio drivers */
#define SDL_AUDIO_DRIVER_DISK 1
#ifndef _WIN32_WCE
#define SDL_AUDIO_DRIVER_DSOUND 1
#endif
......@@ -62,7 +70,6 @@
#ifndef _WIN32_WCE
#define SDL_VIDEO_DRIVER_DDRAW 1
#endif
#define SDL_VIDEO_DRIVER_DUMMY 1
#ifdef _WIN32_WCE
#define SDL_VIDEO_DRIVER_GAPI 1
#endif
......
......@@ -33,6 +33,7 @@
#ifndef SDL_BYTEORDER /* Not defined in SDL_config.h? */
#if (defined(__i386__) || defined(__i386)) || \
defined(_M_IX86) || \
defined(__ia64__) || defined(__x86_64__) || \
(defined(__alpha__) || defined(__alpha)) || \
(defined(__arm__) || defined(__thumb__)) || \
......
......@@ -37,9 +37,6 @@
__declspec(selectany) int _fltused=1;
#endif
#endif /* _MSC_VER */
#define _INC_STDLIB
#define _INC_STRING
#define __STRALIGN_H_
#endif/* !HAVE_LIBC */
#include <windows.h>
......
......@@ -188,6 +188,7 @@ int console_main(int argc, char *argv[])
{
int n;
char *bufp, *appname;
int status;
/* Get the class name from argv[0] */
appname = argv[0];
......@@ -203,7 +204,7 @@ int console_main(int argc, char *argv[])
else
n = (bufp-appname);
bufp = (char *)alloca(n+1);
bufp = SDL_stack_alloc(char, n+1);
if ( bufp == NULL ) {
return OutOfMemory();
}
......@@ -226,13 +227,13 @@ int console_main(int argc, char *argv[])
SDL_SetModuleHandle(GetModuleHandle(NULL));
/* Run the application main() code */
SDL_main(argc, argv);
status = SDL_main(argc, argv);
/* Exit cleanly, calling atexit() functions */
exit(0);
exit(status);
/* Hush little compiler, don't you cry... */
return(0);
return 0;
}
/* This is where execution begins [windowed apps] */
......@@ -262,7 +263,6 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
#ifndef NO_STDIO_REDIRECT
FILE *newfp;
#endif
int retval;
/* Start up DDHELP.EXE before opening any files, so DDHELP doesn't
keep them open. This is a hack.. hopefully it will be fixed
......@@ -322,7 +322,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
#ifdef _WIN32_WCE
nLen = wcslen(szCmdLine)+128+1;
bufp = (wchar_t *)alloca(nLen*2);
bufp = SDL_stack_alloc(wchar_t, nLen*2);
wcscpy (bufp, TEXT("\""));
GetModuleFileName(NULL, bufp+1, 128-3);
wcscpy (bufp+wcslen(bufp), TEXT("\" "));
......@@ -334,7 +334,7 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
}
WideCharToMultiByte(CP_ACP, 0, bufp, -1, cmdline, nLen, NULL, NULL);
#else
/* Grab the command line (use alloca() on Windows) */
/* Grab the command line */
bufp = GetCommandLine();
nLen = SDL_strlen(bufp)+1;
cmdline = SDL_stack_alloc(char, nLen);
......@@ -353,9 +353,8 @@ int WINAPI WinMain(HINSTANCE hInst, HINSTANCE hPrev, LPSTR szCmdLine, int sw)
ParseCommandLine(cmdline, argv);
/* Run the main program (after a little SDL initialization) */
retval = console_main(argc, argv);
console_main(argc, argv);
SDL_stack_free(cmdline);
SDL_stack_free(argv);
return retval;
/* Hush little compiler, don't you cry... */
return 0;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment