Skip to content
Permalink
Browse files

It's now possible to build SDL without any C runtime at all on Windows,

using Visual C++ 2005
  • Loading branch information
slouken committed Feb 6, 2006
1 parent da7ad9a commit 5a9698451ad4cbc16564f9295f845d2e08f03401
Showing with 8,883 additions and 602 deletions.
  1. BIN VisualC.zip
  2. +1 −0 configure.in
  3. +6 −0 include/Makefile.am
  4. +0 −2 include/SDL_audio.h
  5. +87 −0 include/SDL_config.h
  6. +39 −0 include/SDL_ctype.h
  7. +0 −2 include/SDL_endian.h
  8. +4 −0 include/SDL_events.h
  9. +16 −14 include/SDL_getenv.h
  10. +1 −1 include/SDL_mouse.h
  11. +13 −1 include/SDL_rwops.h
  12. +34 −0 include/SDL_stdarg.h
  13. +105 −0 include/SDL_stdlib.h
  14. +359 −0 include/SDL_string.h
  15. +1 −2 include/SDL_syswm.h
  16. +22 −22 include/SDL_thread.h
  17. +9 −8 include/SDL_types.h
  18. +0 −2 include/SDL_video.h
  19. +46 −0 include/SDL_windows.h
  20. +3 −2 src/Makefile.am
  21. +25 −23 src/SDL.c
  22. +5 −19 src/SDL_error.c
  23. +18 −68 src/SDL_fatal.c
  24. +11 −3 src/audio/SDL_audio.c
  25. +0 −2 src/audio/SDL_audiocvt.c
  26. +1 −1 src/audio/SDL_audiomem.c
  27. +0 −4 src/audio/SDL_mixer.c
  28. +3 −5 src/audio/SDL_mixer_MMX_VC.c
  29. +3 −0 src/audio/SDL_mixer_MMX_VC.h
  30. +5 −9 src/audio/SDL_wave.c
  31. +4 −4 src/audio/windib/SDL_dibaudio.c
  32. +5 −4 src/audio/windx5/SDL_dx5audio.c
  33. +1 −1 src/audio/windx5/directx.h
  34. +2 −4 src/cdrom/SDL_cdrom.c
  35. +4 −4 src/cdrom/win32/SDL_syscdrom.c
  36. +1 −3 src/events/SDL_active.c
  37. +6 −3 src/events/SDL_events.c
  38. +3 −10 src/events/SDL_keyboard.c
  39. +1 −4 src/events/SDL_mouse.c
  40. +8 −11 src/events/SDL_quit.c
  41. +15 −11 src/file/SDL_rwops.c
  42. +2 −4 src/joystick/SDL_joystick.c
  43. +11 −10 src/joystick/win32/SDL_mmjoystick.c
  44. +1 −2 src/loadso/windows/SDL_loadso.c
  45. +6 −0 src/stdlib/.cvsignore
  46. +15 −0 src/stdlib/Makefile.am
  47. +4 −17 src/{ → stdlib}/SDL_getenv.c
  48. +5,108 −0 src/stdlib/SDL_malloc.c
  49. +418 −0 src/stdlib/SDL_qsort.c
  50. +70 −0 src/stdlib/SDL_stdlib.c
  51. +1,108 −0 src/stdlib/SDL_string.c
  52. +1 −1 src/thread/SDL_systhread.h
  53. +7 −8 src/thread/SDL_thread.c
  54. +1 −3 src/thread/generic/SDL_syscond.c
  55. +1 −3 src/thread/generic/SDL_sysmutex.c
  56. +1 −2 src/thread/generic/SDL_syssem.c
  57. +1 −1 src/thread/os2/SDL_systhread.c
  58. +2 −3 src/thread/win32/SDL_sysmutex.c
  59. +2 −3 src/thread/win32/SDL_syssem.c
  60. +41 −25 src/thread/win32/SDL_systhread.c
  61. +1 −1 src/thread/win32/SDL_systhread_c.h
  62. +1 −1 src/thread/win32/win_ce_semaphore.c
  63. +1 −3 src/timer/SDL_timer.c
  64. +1 −1 src/timer/win32/SDL_systimer.c
  65. +1 −1 src/timer/wince/SDL_systimer.c
  66. +4 −1 src/video/Makefile.am
  67. +2 −5 src/video/SDL_RLEaccel.c
  68. +1 −5 src/video/SDL_blit.c
  69. +1 −3 src/video/SDL_blit_0.c
  70. +0 −2 src/video/SDL_blit_1.c
  71. +0 −2 src/video/SDL_blit_A.c
  72. +0 −2 src/video/SDL_blit_N.c
  73. +7 −8 src/video/SDL_bmp.c
  74. +2 −4 src/video/SDL_cursor.c
  75. +14 −15 src/video/SDL_gamma.c
  76. +0 −139 src/video/SDL_memops.h
  77. +2 −4 src/video/SDL_pixels.c
  78. +2 −5 src/video/SDL_surface.c
  79. +1 −2 src/video/SDL_sysvideo.h
  80. +2 −4 src/video/SDL_video.c
  81. +2 −5 src/video/SDL_yuv.c
  82. +2 −3 src/video/SDL_yuv_sw.c
  83. +140 −0 src/video/e_log.h
  84. +302 −0 src/video/e_pow.h
  85. +493 −0 src/video/e_sqrt.h
  86. +0 −2 src/video/fbcon/SDL_fbelo.h
  87. +172 −0 src/video/math_private.h
  88. +0 −2 src/video/mmx.h
  89. +1 −0 src/video/qtopia/SDL_QWin.h
  90. +1 −1 src/video/wincommon/SDL_lowvideo.h
  91. +5 −5 src/video/wincommon/SDL_sysevents.c
  92. +3 −2 src/video/wincommon/SDL_sysmouse.c
  93. +14 −10 src/video/wincommon/SDL_syswm.c
  94. +2 −3 src/video/wincommon/SDL_wingl.c
  95. +3 −3 src/video/windib/SDL_dibevents.c
  96. +9 −8 src/video/windib/SDL_dibvideo.c
  97. +1 −1 src/video/windib/SDL_dibvideo.h
  98. +6 −4 src/video/windx5/SDL_dx5events.c
  99. +14 −10 src/video/windx5/SDL_dx5video.c
  100. +2 −3 src/video/windx5/SDL_dx5yuv.c
  101. +1 −1 src/video/windx5/directx.h
BIN +2.17 KB (110%) VisualC.zip
Binary file not shown.
@@ -3008,6 +3008,7 @@ src/main/Makefile
src/main/macos/Makefile
src/main/macosx/Makefile
src/main/macosx/Info.plist
src/stdlib/Makefile
src/audio/Makefile
src/audio/alsa/Makefile
src/audio/arts/Makefile
@@ -10,8 +10,10 @@ libSDLinclude_HEADERS = \
SDL_audio.h \
SDL_byteorder.h \
SDL_cdrom.h \
SDL_config.h \
SDL_copying.h \
SDL_cpuinfo.h \
SDL_ctype.h \
SDL_endian.h \
SDL_error.h \
SDL_events.h \
@@ -27,11 +29,15 @@ libSDLinclude_HEADERS = \
SDL_opengl.h \
SDL_quit.h \
SDL_rwops.h \
SDL_stdarg.h \
SDL_stdlib.h \
SDL_string.h \
SDL_syswm.h \
SDL_thread.h \
SDL_timer.h \
SDL_types.h \
SDL_version.h \
SDL_video.h \
SDL_windows.h \
begin_code.h \
close_code.h
@@ -25,8 +25,6 @@
#ifndef _SDL_audio_h
#define _SDL_audio_h

#include <stdio.h>

#include "SDL_main.h"
#include "SDL_types.h"
#include "SDL_error.h"
@@ -0,0 +1,87 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/

#ifndef _SDL_config_h
#define _SDL_config_h

/* This is a set of defines to configure the SDL features */

#define HAVE_STDARG_H

/* Comment this if you want to build without any libc requirements */
#define HAVE_LIBC
#ifdef HAVE_LIBC

/* Various C library headers */
#define HAVE_CTYPE_H
#define HAVE_STDIO_H
#define HAVE_STDLIB_H
#define HAVE_MALLOC_H
#define HAVE_STRING_H
#if !defined(_WIN32_WCE)
#define HAVE_SIGNAL_H
#endif

/* Features provided by SDL_stdlib.h */
#if !defined(_WIN32) /* Don't use C runtime versions of these on Windows */
#define HAVE_GETENV
#define HAVE_PUTENV
#endif
#define HAVE_MALLOC
#define HAVE_REALLOC
#define HAVE_FREE
#define HAVE_ALLOCA
/*#define HAVE_QSORT*/

/* Features provided by SDL_string.h */
#define HAVE_MEMSET
#define HAVE_MEMCPY
#define HAVE_MEMMOVE
#define HAVE_MEMCMP
#define HAVE_STRLEN
#define HAVE_STRCPY
#define HAVE_STRNCPY
/*#define HAVE__STRREV*/
/*#define HAVE__STRUPR*/
/*#define HAVE__STRLWR*/
#define HAVE_STRCHR
#define HAVE_STRRCHR
#define HAVE_STRSTR
/*#define HAVE_ITOA*/
/*#define HAVE__LTOA*/
/*#define HAVE__UITOA*/
/*#define HAVE__ULTOA*/
/*#define HAVE_STRTOL*/
/*#define HAVE__I64TOA*/
/*#define HAVE__UI64TOA*/
/*#define HAVE_STRTOLL*/
#define HAVE_STRCMP
#define HAVE_STRNCMP
/*#define HAVE_STRICMP*/
/*#define HAVE_STRCASECMP*/
#define HAVE_SSCANF
/*#define HAVE_SNPRINTF*/
#define HAVE_VSNPRINTF

#endif /* HAVE_LIBC */

#endif /* _SDL_config_h */
@@ -0,0 +1,39 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/

/* This file contains portable character manipulation functions for SDL */

#ifndef _SDL_CTYPE_H_
#define _SDL_CTYPE_H_

#include "SDL_config.h"

#ifdef HAVE_CTYPE_H
#include <ctype.h>
#else
#define isdigit(X) (((X) >= '0') && ((X) <= '9'))
#define isspace(X) (((X) == ' ') || ((X) == '\t') || ((X) == '\r') || ((X) == '\n'))
#define toupper(X) (((X) >= 'a') && ((X) <= 'z') ? ('A'+((X)-'a')) : (X))
#define tolower(X) (((X) >= 'A') && ((X) <= 'Z') ? ('a'+((X)-'A')) : (X))
#endif

#endif /* _SDL_CTYPE_H_ */
@@ -37,8 +37,6 @@
and other data sources.
*/

#include <stdio.h>

#include "SDL_types.h"
#include "SDL_rwops.h"
#include "SDL_byteorder.h"
@@ -38,6 +38,10 @@
extern "C" {
#endif

/* General keyboard/mouse state definitions */
#define SDL_RELEASED 0
#define SDL_PRESSED 1

/* Event enumerations */
typedef enum {
SDL_NOEVENT = 0, /* Unused (do not remove) */
@@ -23,29 +23,31 @@
#ifndef _SDL_getenv_h
#define _SDL_getenv_h

#include "SDL_config.h"

#ifdef HAVE_STDLIB_H
#include <stdlib.h>
#endif

#include "begin_code.h"
/* Set up for C function definitions, even when using C++ */
#ifdef __cplusplus
extern "C" {
#endif

/* Not all environments have a working getenv()/putenv() */

#if defined(macintosh) || defined(WIN32) || defined(_WIN32_WCE)
#define NEED_SDL_GETENV
#ifdef HAVE_GETENV
#define SDL_getenv getenv
#else
#define getenv SDL_getenv
extern DECLSPEC char * SDLCALL SDL_getenv(const char *name);
#endif

#ifdef NEED_SDL_GETENV

/* Put a variable of the form "name=value" into the environment */
#ifdef HAVE_PUTENV
#define SDL_putenv putenv
#else
#define putenv SDL_putenv
extern DECLSPEC int SDLCALL SDL_putenv(const char *variable);
#define putenv(X) SDL_putenv(X)

/* Retrieve a variable named "name" from the environment */
extern DECLSPEC char * SDLCALL SDL_getenv(const char *name);
#define getenv(X) SDL_getenv(X)

#endif /* NEED_GETENV */
#endif

/* Ends C function definitions when using C++ */
#ifdef __cplusplus
@@ -115,7 +115,7 @@ extern DECLSPEC int SDLCALL SDL_ShowCursor(int toggle);
Button 4: Mouse wheel up (may also be a real button)
Button 5: Mouse wheel down (may also be a real button)
*/
#define SDL_BUTTON(X) (SDL_PRESSED << ((X)-1))
#define SDL_BUTTON(X) (1 << ((X)-1))
#define SDL_BUTTON_LEFT 1
#define SDL_BUTTON_MIDDLE 2
#define SDL_BUTTON_RIGHT 3
@@ -27,7 +27,11 @@
#ifndef _SDL_RWops_h
#define _SDL_RWops_h

#include "SDL_config.h"

#ifdef HAVE_STDIO_H
#include <stdio.h>
#endif

#include "SDL_types.h"

@@ -63,10 +67,12 @@ typedef struct SDL_RWops {

Uint32 type;
union {
#ifdef HAVE_STDIO_H
struct {
int autoclose;
FILE *fp;
} stdio;
#endif
struct {
Uint8 *base;
Uint8 *here;
@@ -84,17 +90,23 @@ typedef struct SDL_RWops {

extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFile(const char *file, const char *mode);

#ifdef HAVE_STDIO_H
extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromFP(FILE *fp, int autoclose);
#endif

extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromMem(void *mem, int size);
extern DECLSPEC SDL_RWops * SDLCALL SDL_RWFromConstMem(const void *mem, int size);

extern DECLSPEC SDL_RWops * SDLCALL SDL_AllocRW(void);
extern DECLSPEC void SDLCALL SDL_FreeRW(SDL_RWops *area);

#define RW_SEEK_SET 0 /* Seek from the beginning of data */
#define RW_SEEK_CUR 1 /* Seek relative to current read point */
#define RW_SEEK_END 2 /* Seek relative to the end of data */

/* Macros to easily read and write from an SDL_RWops structure */
#define SDL_RWseek(ctx, offset, whence) (ctx)->seek(ctx, offset, whence)
#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, SEEK_CUR)
#define SDL_RWtell(ctx) (ctx)->seek(ctx, 0, RW_SEEK_CUR)
#define SDL_RWread(ctx, ptr, size, n) (ctx)->read(ctx, ptr, size, n)
#define SDL_RWwrite(ctx, ptr, size, n) (ctx)->write(ctx, ptr, size, n)
#define SDL_RWclose(ctx) (ctx)->close(ctx)
@@ -0,0 +1,34 @@
/*
SDL - Simple DirectMedia Layer
Copyright (C) 1997-2006 Sam Lantinga
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Sam Lantinga
slouken@libsdl.org
*/

#ifndef _SDL_stdarg_h
#define _SDL_stdarg_h

#include "SDL_config.h"

#ifdef HAVE_STDARG_H
#include <stdarg.h>
#else
#error Need stdarg.h equivalent for this platform
#endif

#endif /* _SDL_stdarg_h */

0 comments on commit 5a96984

Please sign in to comment.