src/file/SDL_rwops.c
changeset 8535 e8ee0708ef5c
parent 8477 ad08f0d710f3
parent 7828 1451063c8ecd
child 8582 c3e9a2b93517
     1.1 --- a/src/file/SDL_rwops.c	Sun Oct 27 14:31:57 2013 -0400
     1.2 +++ b/src/file/SDL_rwops.c	Sun Oct 27 21:26:46 2013 -0400
     1.3 @@ -22,6 +22,11 @@
     1.4  #define _LARGEFILE64_SOURCE
     1.5  #include "SDL_config.h"
     1.6  
     1.7 +#if defined(__WIN32__)
     1.8 +#include "../core/windows/SDL_windows.h"
     1.9 +#endif
    1.10 +
    1.11 +
    1.12  /* This file provides a general interface for SDL to read and write
    1.13     data sources.  It can easily be extended to files, memory, etc.
    1.14  */
    1.15 @@ -42,8 +47,6 @@
    1.16  
    1.17  /* Functions to read/write Win32 API file pointers */
    1.18  
    1.19 -#include "../core/windows/SDL_windows.h"
    1.20 -
    1.21  #ifndef INVALID_SET_FILE_POINTER
    1.22  #define INVALID_SET_FILE_POINTER 0xFFFFFFFF
    1.23  #endif
    1.24 @@ -275,10 +278,8 @@
    1.25              CloseHandle(context->hidden.windowsio.h);
    1.26              context->hidden.windowsio.h = INVALID_HANDLE_VALUE;   /* to be sure */
    1.27          }
    1.28 -        if (context->hidden.windowsio.buffer.data) {
    1.29 -            SDL_free(context->hidden.windowsio.buffer.data);
    1.30 -            context->hidden.windowsio.buffer.data = NULL;
    1.31 -        }
    1.32 +        SDL_free(context->hidden.windowsio.buffer.data);
    1.33 +        context->hidden.windowsio.buffer.data = NULL;
    1.34          SDL_FreeRW(context);
    1.35      }
    1.36      return (0);