src/SDL.c
changeset 1330 450721ad5436
parent 1312 c9b51268668f
child 1336 3692456e7b0f
     1.1 --- a/src/SDL.c	Sat Feb 04 22:01:44 2006 +0000
     1.2 +++ b/src/SDL.c	Mon Feb 06 08:28:51 2006 +0000
     1.3 @@ -22,7 +22,6 @@
     1.4  
     1.5  /* Initialization code for SDL */
     1.6  
     1.7 -#include <stdlib.h>		/* For getenv() */
     1.8  #ifdef ENABLE_PTH
     1.9  #include <pth.h>
    1.10  #endif
    1.11 @@ -30,6 +29,7 @@
    1.12  #include "SDL.h"
    1.13  #include "SDL_endian.h"
    1.14  #include "SDL_fatal.h"
    1.15 +#include "SDL_stdlib.h"
    1.16  #ifndef DISABLE_VIDEO
    1.17  #include "SDL_leaks.h"
    1.18  #endif
    1.19 @@ -253,26 +253,7 @@
    1.20  	return(&version);
    1.21  }
    1.22  
    1.23 -#ifndef __OS2__
    1.24 -#if defined(_WIN32_WCE) || (defined(__WATCOMC__) && defined(BUILD_DLL))
    1.25 -/* Need to include DllMain() on Windows CE and Watcom C for some reason.. */
    1.26 -#include <windows.h>
    1.27 -
    1.28 -BOOL APIENTRY DllMain( HANDLE hModule, 
    1.29 -                       DWORD  ul_reason_for_call, 
    1.30 -                       LPVOID lpReserved )
    1.31 -{
    1.32 -	switch (ul_reason_for_call) {
    1.33 -		case DLL_PROCESS_ATTACH:
    1.34 -		case DLL_THREAD_ATTACH:
    1.35 -		case DLL_THREAD_DETACH:
    1.36 -		case DLL_PROCESS_DETACH:
    1.37 -			break;
    1.38 -	}
    1.39 -	return TRUE;
    1.40 -}
    1.41 -#endif /* _WIN32_WCE and building DLL with Watcom C */
    1.42 -#else
    1.43 +#if defined(__OS2__)
    1.44  // Building for OS/2
    1.45  #ifdef __WATCOMC__
    1.46  
    1.47 @@ -341,6 +322,27 @@
    1.48      return 1;
    1.49    }
    1.50  }
    1.51 +#endif /* __WATCOMC__ */
    1.52  
    1.53 -#endif
    1.54 -#endif
    1.55 +#elif defined(_WIN32)
    1.56 +
    1.57 +#if !defined(HAVE_LIBC) || defined(_WIN32_WCE) || (defined(__WATCOMC__) && defined(BUILD_DLL))
    1.58 +/* Need to include DllMain() on Windows CE and Watcom C for some reason.. */
    1.59 +#include "SDL_windows.h"
    1.60 +
    1.61 +BOOL APIENTRY _DllMainCRTStartup( HANDLE hModule, 
    1.62 +                       DWORD  ul_reason_for_call, 
    1.63 +                       LPVOID lpReserved )
    1.64 +{
    1.65 +	switch (ul_reason_for_call) {
    1.66 +		case DLL_PROCESS_ATTACH:
    1.67 +		case DLL_THREAD_ATTACH:
    1.68 +		case DLL_THREAD_DETACH:
    1.69 +		case DLL_PROCESS_DETACH:
    1.70 +			break;
    1.71 +	}
    1.72 +	return TRUE;
    1.73 +}
    1.74 +#endif /* _WIN32_WCE and building DLL with Watcom C */
    1.75 +
    1.76 +#endif /* OS/2 elif _WIN32 */