src/SDL_assert.c
changeset 8316 88f011703f39
parent 6305 601b0e251822
child 8337 4a67a3cca43d
     1.1 --- a/src/SDL_assert.c	Mon Oct 15 22:25:08 2012 -0400
     1.2 +++ b/src/SDL_assert.c	Wed Oct 17 21:43:20 2012 -0400
     1.3 @@ -26,7 +26,7 @@
     1.4  #include "SDL_assert_c.h"
     1.5  #include "video/SDL_sysvideo.h"
     1.6  
     1.7 -#ifdef __WIN32__
     1.8 +#if defined(__WIN32__) || defined(__WINRT__)
     1.9  #include "core/windows/SDL_windows.h"
    1.10  
    1.11  #ifndef WS_OVERLAPPEDWINDOW
    1.12 @@ -59,7 +59,7 @@
    1.13  static void
    1.14  debug_print(const char *fmt, ...)
    1.15  {
    1.16 -#ifdef __WIN32__
    1.17 +#if defined(__WIN32__) || defined(__WINRT__)
    1.18      /* Format into a buffer for OutputDebugStringA(). */
    1.19      char buf[1024];
    1.20      char *startptr;
    1.21 @@ -213,6 +213,18 @@
    1.22  #endif
    1.23  
    1.24  
    1.25 +#ifdef __WINRT__
    1.26 +
    1.27 +static SDL_assert_state
    1.28 +SDL_PromptAssertion_windowsrt(const SDL_assert_data *data)
    1.29 +{
    1.30 +    /* TODO, WinRT: implement SDL_PromptAssertion_windowsrt */
    1.31 +    return SDL_ASSERTION_ABORT;
    1.32 +}
    1.33 +
    1.34 +#endif
    1.35 +
    1.36 +
    1.37  static void SDL_AddAssertionToReport(SDL_assert_data *data)
    1.38  {
    1.39      /* (data) is always a static struct defined with the assert macros, so
    1.40 @@ -254,8 +266,10 @@
    1.41  
    1.42  static void SDL_ExitProcess(int exitcode)
    1.43  {
    1.44 -#ifdef __WIN32__
    1.45 +#if defined(__WIN32__)
    1.46      ExitProcess(exitcode);
    1.47 +#elif defined(__WINRT__)
    1.48 +    exit(exitcode);
    1.49  #else
    1.50      _exit(exitcode);
    1.51  #endif
    1.52 @@ -317,9 +331,12 @@
    1.53  
    1.54      /* platform-specific UI... */
    1.55  
    1.56 -#ifdef __WIN32__
    1.57 +#if defined(__WIN32__)
    1.58      state = SDL_PromptAssertion_windows(data);
    1.59  
    1.60 +#elif defined(__WINRT__)
    1.61 +    state = SDL_PromptAssertion_windowsrt(data);
    1.62 +
    1.63  #elif defined __MACOSX__ && defined SDL_VIDEO_DRIVER_COCOA
    1.64      /* This has to be done in an Objective-C (*.m) file, so we call out. */
    1.65      extern SDL_assert_state SDL_PromptAssertion_cocoa(const SDL_assert_data *);