Removed STL dependency in Android code.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 15 Oct 2011 14:16:29 -0700
changeset 5994153d15ab3032
parent 5993 c9cb52d6d864
child 5995 037af0e98bd0
Removed STL dependency in Android code.
src/core/android/SDL_android.cpp
     1.1 --- a/src/core/android/SDL_android.cpp	Fri Oct 14 17:29:49 2011 +0100
     1.2 +++ b/src/core/android/SDL_android.cpp	Sat Oct 15 14:16:29 2011 -0700
     1.3 @@ -23,8 +23,6 @@
     1.4  
     1.5  #include "SDL_android.h"
     1.6  
     1.7 -#include <algorithm>
     1.8 -
     1.9  extern "C" {
    1.10  #include "../../events/SDL_events_c.h"
    1.11  #include "../../video/android/SDL_androidkeyboard.h"
    1.12 @@ -521,8 +519,11 @@
    1.13  
    1.14          // The easy case where we're seeking forwards
    1.15          while (movement > 0) {
    1.16 -            size_t result = Android_JNI_FileRead(ctx, buffer, 1,
    1.17 -                std::min(movement, (long)sizeof(buffer)));
    1.18 +            long amount = (long) sizeof (buffer);
    1.19 +            if (amount > movement) {
    1.20 +                amount = movement;
    1.21 +            }
    1.22 +            size_t result = Android_JNI_FileRead(ctx, buffer, 1, amount);
    1.23  
    1.24              if (result <= 0) {
    1.25                  // Failed to read/skip the required amount, so fail