Skip to content

Commit

Permalink
Updated for Visual Studio Express 2005
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Feb 24, 2006
1 parent 2111d89 commit 38b3c4a
Show file tree
Hide file tree
Showing 10 changed files with 22 additions and 24 deletions.
Binary file modified VisualC.zip
Binary file not shown.
1 change: 1 addition & 0 deletions include/SDL.h
Expand Up @@ -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"
Expand Down
2 changes: 0 additions & 2 deletions include/SDL_config_amiga.h
Expand Up @@ -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
Expand All @@ -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
Expand Down
2 changes: 0 additions & 2 deletions include/SDL_config_dreamcast.h
Expand Up @@ -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
Expand All @@ -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 */
2 changes: 0 additions & 2 deletions include/SDL_config_macos.h
Expand Up @@ -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 */
Expand All @@ -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 */
Expand Down
1 change: 0 additions & 1 deletion include/SDL_config_macosx.h
Expand Up @@ -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 */
Expand Down
13 changes: 10 additions & 3 deletions include/SDL_config_win32.h
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions include/SDL_endian.h
Expand Up @@ -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__)) || \
Expand Down
3 changes: 0 additions & 3 deletions include/SDL_windows.h
Expand Up @@ -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>

Expand Down
21 changes: 10 additions & 11 deletions src/main/win32/SDL_win32_main.c
Expand Up @@ -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];
Expand All @@ -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();
}
Expand All @@ -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] */
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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("\" "));
Expand All @@ -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);
Expand All @@ -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;
}

0 comments on commit 38b3c4a

Please sign in to comment.