Removed STL dependency in Android code.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 15 Oct 2011 14:16:29 -0700
changeset 5994 153d15ab3032
parent 5993 c9cb52d6d864
child 5995 037af0e98bd0
Removed STL dependency in Android code.
src/core/android/SDL_android.cpp
--- a/src/core/android/SDL_android.cpp	Fri Oct 14 17:29:49 2011 +0100
+++ b/src/core/android/SDL_android.cpp	Sat Oct 15 14:16:29 2011 -0700
@@ -23,8 +23,6 @@
 
 #include "SDL_android.h"
 
-#include <algorithm>
-
 extern "C" {
 #include "../../events/SDL_events_c.h"
 #include "../../video/android/SDL_androidkeyboard.h"
@@ -521,8 +519,11 @@
 
         // The easy case where we're seeking forwards
         while (movement > 0) {
-            size_t result = Android_JNI_FileRead(ctx, buffer, 1,
-                std::min(movement, (long)sizeof(buffer)));
+            long amount = (long) sizeof (buffer);
+            if (amount > movement) {
+                amount = movement;
+            }
+            size_t result = Android_JNI_FileRead(ctx, buffer, 1, amount);
 
             if (result <= 0) {
                 // Failed to read/skip the required amount, so fail