author Sam Lantinga <>
Tue, 02 Apr 2013 07:57:37 -0700
changeset 7045 4be2c24b7de1
parent 6674 45a21e50ba5e
permissions -rw-r--r--
Fixed bug 1780 - SDL_RWFromFile() sets an error on Android although a valid SDL_RWops pointer is returned.

Philipp Wiesemann

SDL_RWFromFile() sets an error to be queried with SDL_GetError() on Android although a valid SDL_RWops pointer is returned.

This happens if the fallback implemented in SDL_android.cpp is used to load compressed assets (see in section "Loading assets") and results in a message like " This file can not be opened as a file descriptor; it is probably compressed". I think this is confusing and not needed because the loading works as expected.

I attached a patch which changes SDL_android.cpp to not set an error if compressed assets are loaded. In this case also no Exception is queried and no additional string are created.
     1 ================================================================================
     2 CMake build system for SDL (
     3 ================================================================================
     5 SDL's build system was traditionally based on autotools. Over time, this
     6 approach has suffered from several issues across the different supported 
     7 platforms.
     8 To solve these problems, a new build system based on CMake is under development.
     9 It works in parallel to the legacy system, so users can experiment with it
    10 without complication.
    11 While still experimental, the build system should be usable on the following
    12 platforms:
    14     * FreeBSD
    15     * Linux
    16     * VS.NET 2010
    17     * MinGW and Msys
    18     * OS X with support for XCode
    20 ================================================================================
    21 Usage
    22 ================================================================================
    24 Assuming the source for SDL is located at ~/sdl
    26 cd ~
    27 mkdir build
    28 cd build
    29 cmake ../sdl
    31 This will build the static and dynamic versions of SDL in the ~/build directory.