No C runtime!

The latest version of SDL in CVS can be built under Visual C++ 2005 without
any C runtime dependencies at all! This allows redistribution of the SDL.dll
without worrying about which version of C runtime is used by the appliation.

You can try this out yourself:
http://www.libsdl.org/cvs/SDL.dll

Caveats:

  • The application must be rebuilt with the new headers if it uses threads,
    since the function signature changed to handle passing in initialize/destroy
    routines from the C runtime (thanks to the OS/2 port for that trick!)
  • I haven’t implemented the ftol or 64-bit math intrinsics.

If you want to build this yourself to play with it, grab the latest CVS tarball:
http://www.libsdl.org/cvs/SDL-1.2.zip
Edit SDL_config.h and change #define HAVE_LIBC to #undef HAVE_LIBC
Edit the SDL project settings and set the “no default libs” option

Please send patches if I’ve broken anything or missed something.

Thanks!
-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

Hello !

The latest version of SDL in CVS can be built under Visual C++ 2005
without any C runtime dependencies at all! This allows redistribution of
the SDL.dll without worrying about which version of C runtime is used by
the appliation.

How is that possible ? My thought always was that
the C runtime is necessary for the C Compiler to
get in contact with the OS, so that it can alloc
memory and such things.

CU

How is that possible ? My thought always was that
the C runtime is necessary for the C Compiler to
get in contact with the OS, so that it can alloc
memory and such things.

Magic. :slight_smile:

-Sam Lantinga, Senior Software Engineer, Blizzard Entertainment

Sam Lantinga wrote:

How is that possible ? My thought always was that
the C runtime is necessary for the C Compiler to
get in contact with the OS, so that it can alloc
memory and such things.

Magic. :slight_smile:

looks like they have a mini libC reimplamentation under
src/stdlib

$>ls src/stdlib
CVS SDL_getenv.c SDL_qsort.c SDL_string.c
Makefile.am SDL_malloc.c SDL_stdlib.c

$>sloccount src/stdlib
Creating filelist for stdlib

SLOC Directory SLOC-by-Language (Sorted)
4242 stdlib ansic=4242

Totals grouped by language (dominant language first):
ansic: 4242 (100.00%)

.bill