The jump hack is no longer used.
authorSam Lantinga <slouken@libsdl.org>
Wed, 05 Jun 2013 21:47:49 -0700
changeset 7284ac3f4830ae25
parent 7283 57c4dad63daf
child 7285 bcfd0bcaf4f3
The jump hack is no longer used.

Cheers!
Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj
src/video/uikit/SDL_uikitappdelegate.m
src/video/uikit/SDL_uikitevents.m
src/video/uikit/jumphack.c
src/video/uikit/jumphack.h
     1.1 --- a/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj	Wed Jun 05 21:38:54 2013 -0700
     1.2 +++ b/Xcode-iOS/SDL/SDL.xcodeproj/project.pbxproj	Wed Jun 05 21:47:49 2013 -0700
     1.3 @@ -25,14 +25,14 @@
     1.4  		006E9852119550FB001DE610 /* audio.c in Sources */ = {isa = PBXBuildFile; fileRef = 006E9831119550FB001DE610 /* audio.c */; };
     1.5  		006E9853119550FB001DE610 /* common.c in Sources */ = {isa = PBXBuildFile; fileRef = 006E9834119550FB001DE610 /* common.c */; };
     1.6  		006E9859119550FB001DE610 /* platform.c in Sources */ = {isa = PBXBuildFile; fileRef = 006E983D119550FB001DE610 /* platform.c */; };
     1.7 -		006E985A119550FB001DE610 /* README in Resources */ = {isa = PBXBuildFile; fileRef = 006E983F119550FB001DE610 /* README */; };
     1.8 +		006E985A119550FB001DE610 /* (null) in Resources */ = {isa = PBXBuildFile; };
     1.9  		006E985B119550FB001DE610 /* rect.c in Sources */ = {isa = PBXBuildFile; fileRef = 006E9841119550FB001DE610 /* rect.c */; };
    1.10  		006E985C119550FB001DE610 /* render.c in Sources */ = {isa = PBXBuildFile; fileRef = 006E9844119550FB001DE610 /* render.c */; };
    1.11  		006E985D119550FB001DE610 /* read in Copy rwops */ = {isa = PBXBuildFile; fileRef = 006E9847119550FB001DE610 /* read */; };
    1.12  		006E985E119550FB001DE610 /* rwops.c in Sources */ = {isa = PBXBuildFile; fileRef = 006E9848119550FB001DE610 /* rwops.c */; };
    1.13 -		006E9860119550FB001DE610 /* SDL_at.c in Sources */ = {isa = PBXBuildFile; fileRef = 006E984C119550FB001DE610 /* SDL_at.c */; };
    1.14 +		006E9860119550FB001DE610 /* (null) in Sources */ = {isa = PBXBuildFile; };
    1.15  		006E9861119550FB001DE610 /* surface.c in Sources */ = {isa = PBXBuildFile; fileRef = 006E984F119550FB001DE610 /* surface.c */; };
    1.16 -		006E9862119550FB001DE610 /* testsdl.c in Sources */ = {isa = PBXBuildFile; fileRef = 006E9851119550FB001DE610 /* testsdl.c */; };
    1.17 +		006E9862119550FB001DE610 /* (null) in Sources */ = {isa = PBXBuildFile; };
    1.18  		006E986A1195513D001DE610 /* icon.bmp in Resources */ = {isa = PBXBuildFile; fileRef = 006E98631195513D001DE610 /* icon.bmp */; };
    1.19  		006E986B1195513D001DE610 /* moose.dat in Resources */ = {isa = PBXBuildFile; fileRef = 006E98641195513D001DE610 /* moose.dat */; };
    1.20  		006E986C1195513D001DE610 /* picture.xbm in Resources */ = {isa = PBXBuildFile; fileRef = 006E98651195513D001DE610 /* picture.xbm */; };
    1.21 @@ -235,8 +235,6 @@
    1.22  		FDA685FC0DF244C800F98A1A /* SDL_nullevents_c.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA685F60DF244C800F98A1A /* SDL_nullevents_c.h */; };
    1.23  		FDA685FF0DF244C800F98A1A /* SDL_nullvideo.c in Sources */ = {isa = PBXBuildFile; fileRef = FDA685F90DF244C800F98A1A /* SDL_nullvideo.c */; };
    1.24  		FDA686000DF244C800F98A1A /* SDL_nullvideo.h in Headers */ = {isa = PBXBuildFile; fileRef = FDA685FA0DF244C800F98A1A /* SDL_nullvideo.h */; };
    1.25 -		FDC656480E560DF800311C8E /* jumphack.c in Sources */ = {isa = PBXBuildFile; fileRef = FDC656440E560DF800311C8E /* jumphack.c */; };
    1.26 -		FDC656490E560DF800311C8E /* jumphack.h in Headers */ = {isa = PBXBuildFile; fileRef = FDC656450E560DF800311C8E /* jumphack.h */; };
    1.27  /* End PBXBuildFile section */
    1.28  
    1.29  /* Begin PBXContainerItemProxy section */
    1.30 @@ -265,30 +263,16 @@
    1.31  
    1.32  /* Begin PBXFileReference section */
    1.33  		001E39A51196EE6F00A3F5B8 /* TestSupportRWops_Cocoa.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; path = TestSupportRWops_Cocoa.m; sourceTree = "<group>"; };
    1.34 -		001E39A61196EE6F00A3F5B8 /* TestSupportRWops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TestSupportRWops.h; sourceTree = "<group>"; };
    1.35  		006E982211955059001DE610 /* testsdl.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = testsdl.app; sourceTree = BUILT_PRODUCTS_DIR; };
    1.36  		006E982411955059001DE610 /* testsdl-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "testsdl-Info.plist"; sourceTree = "<group>"; };
    1.37  		006E9831119550FB001DE610 /* audio.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = audio.c; sourceTree = "<group>"; };
    1.38 -		006E9832119550FB001DE610 /* audio.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = audio.h; sourceTree = "<group>"; };
    1.39  		006E9834119550FB001DE610 /* common.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = common.c; sourceTree = "<group>"; };
    1.40 -		006E9835119550FB001DE610 /* common.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = common.h; sourceTree = "<group>"; };
    1.41 -		006E9836119550FB001DE610 /* images.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = images.h; sourceTree = "<group>"; };
    1.42 -		006E9837119550FB001DE610 /* img_blit.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_blit.c; sourceTree = "<group>"; };
    1.43 -		006E9838119550FB001DE610 /* img_blitblend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_blitblend.c; sourceTree = "<group>"; };
    1.44 -		006E9839119550FB001DE610 /* img_face.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_face.c; sourceTree = "<group>"; };
    1.45 -		006E983A119550FB001DE610 /* img_primitives.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_primitives.c; sourceTree = "<group>"; };
    1.46 -		006E983B119550FB001DE610 /* img_primitivesblend.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = img_primitivesblend.c; sourceTree = "<group>"; };
    1.47  		006E983D119550FB001DE610 /* platform.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = platform.c; sourceTree = "<group>"; };
    1.48 -		006E983E119550FB001DE610 /* platform.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = platform.h; sourceTree = "<group>"; };
    1.49  		006E9841119550FB001DE610 /* rect.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rect.c; sourceTree = "<group>"; };
    1.50 -		006E9842119550FB001DE610 /* rect.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rect.h; sourceTree = "<group>"; };
    1.51  		006E9844119550FB001DE610 /* render.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = render.c; sourceTree = "<group>"; };
    1.52 -		006E9845119550FB001DE610 /* render.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = render.h; sourceTree = "<group>"; };
    1.53  		006E9847119550FB001DE610 /* read */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = read; sourceTree = "<group>"; };
    1.54  		006E9848119550FB001DE610 /* rwops.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = rwops.c; sourceTree = "<group>"; };
    1.55 -		006E9849119550FB001DE610 /* rwops.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = rwops.h; sourceTree = "<group>"; };
    1.56  		006E984F119550FB001DE610 /* surface.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = surface.c; sourceTree = "<group>"; };
    1.57 -		006E9850119550FB001DE610 /* surface.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = surface.h; sourceTree = "<group>"; };
    1.58  		006E98631195513D001DE610 /* icon.bmp */ = {isa = PBXFileReference; lastKnownFileType = image.bmp; name = icon.bmp; path = ../../test/icon.bmp; sourceTree = SOURCE_ROOT; };
    1.59  		006E98641195513D001DE610 /* moose.dat */ = {isa = PBXFileReference; lastKnownFileType = file; name = moose.dat; path = ../../test/moose.dat; sourceTree = SOURCE_ROOT; };
    1.60  		006E98651195513D001DE610 /* picture.xbm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; name = picture.xbm; path = ../../test/picture.xbm; sourceTree = SOURCE_ROOT; };
    1.61 @@ -515,8 +499,6 @@
    1.62  		FDA685F90DF244C800F98A1A /* SDL_nullvideo.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = SDL_nullvideo.c; sourceTree = "<group>"; };
    1.63  		FDA685FA0DF244C800F98A1A /* SDL_nullvideo.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SDL_nullvideo.h; sourceTree = "<group>"; };
    1.64  		FDC261780E3A3FC8001C4554 /* keyinfotable.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = keyinfotable.h; sourceTree = "<group>"; };
    1.65 -		FDC656440E560DF800311C8E /* jumphack.c */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.c; path = jumphack.c; sourceTree = "<group>"; };
    1.66 -		FDC656450E560DF800311C8E /* jumphack.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = jumphack.h; sourceTree = "<group>"; };
    1.67  /* End PBXFileReference section */
    1.68  
    1.69  /* Begin PBXFrameworksBuildPhase section */
    1.70 @@ -754,8 +736,6 @@
    1.71  		FD689F090E26E5D900F90B21 /* uikit */ = {
    1.72  			isa = PBXGroup;
    1.73  			children = (
    1.74 -				FDC656440E560DF800311C8E /* jumphack.c */,
    1.75 -				FDC656450E560DF800311C8E /* jumphack.h */,
    1.76  				FDC261780E3A3FC8001C4554 /* keyinfotable.h */,
    1.77  				FD689FCD0E26E9D400F90B21 /* SDL_uikitappdelegate.h */,
    1.78  				FD689FCC0E26E9D400F90B21 /* SDL_uikitappdelegate.m */,
    1.79 @@ -1084,7 +1064,6 @@
    1.80  				FD689F240E26E5D900F90B21 /* SDL_uikitwindow.h in Headers */,
    1.81  				FD689F260E26E5D900F90B21 /* SDL_uikitopenglview.h in Headers */,
    1.82  				FD689FCF0E26E9D400F90B21 /* SDL_uikitappdelegate.h in Headers */,
    1.83 -				FDC656490E560DF800311C8E /* jumphack.h in Headers */,
    1.84  				047677BD0EA76A31008ABAF1 /* SDL_syshaptic.h in Headers */,
    1.85  				046387420F0B5B7D0041FD65 /* SDL_blit_slow.h in Headers */,
    1.86  				006E9888119552DD001DE610 /* SDL_rwopsbundlesupport.h in Headers */,
    1.87 @@ -1239,7 +1218,7 @@
    1.88  			isa = PBXResourcesBuildPhase;
    1.89  			buildActionMask = 2147483647;
    1.90  			files = (
    1.91 -				006E985A119550FB001DE610 /* README in Resources */,
    1.92 +				006E985A119550FB001DE610 /* (null) in Resources */,
    1.93  				006E986A1195513D001DE610 /* icon.bmp in Resources */,
    1.94  				006E986B1195513D001DE610 /* moose.dat in Resources */,
    1.95  				006E986C1195513D001DE610 /* picture.xbm in Resources */,
    1.96 @@ -1279,9 +1258,9 @@
    1.97  				006E985B119550FB001DE610 /* rect.c in Sources */,
    1.98  				006E985C119550FB001DE610 /* render.c in Sources */,
    1.99  				006E985E119550FB001DE610 /* rwops.c in Sources */,
   1.100 -				006E9860119550FB001DE610 /* SDL_at.c in Sources */,
   1.101 +				006E9860119550FB001DE610 /* (null) in Sources */,
   1.102  				006E9861119550FB001DE610 /* surface.c in Sources */,
   1.103 -				006E9862119550FB001DE610 /* testsdl.c in Sources */,
   1.104 +				006E9862119550FB001DE610 /* (null) in Sources */,
   1.105  				001E39A71196EE6F00A3F5B8 /* TestSupportRWops_Cocoa.m in Sources */,
   1.106  			);
   1.107  			runOnlyForDeploymentPostprocessing = 0;
   1.108 @@ -1347,7 +1326,6 @@
   1.109  				FD689F270E26E5D900F90B21 /* SDL_uikitopenglview.m in Sources */,
   1.110  				FD689FCE0E26E9D400F90B21 /* SDL_uikitappdelegate.m in Sources */,
   1.111  				FD8BD8250E27E25900B52CD5 /* SDL_sysloadso.c in Sources */,
   1.112 -				FDC656480E560DF800311C8E /* jumphack.c in Sources */,
   1.113  				047677BB0EA76A31008ABAF1 /* SDL_syshaptic.c in Sources */,
   1.114  				047677BC0EA76A31008ABAF1 /* SDL_haptic.c in Sources */,
   1.115  				047AF1B30EA98D6C00811173 /* SDL_sysloadso.c in Sources */,
     2.1 --- a/src/video/uikit/SDL_uikitappdelegate.m	Wed Jun 05 21:38:54 2013 -0700
     2.2 +++ b/src/video/uikit/SDL_uikitappdelegate.m	Wed Jun 05 21:47:49 2013 -0700
     2.3 @@ -32,7 +32,6 @@
     2.4  #include "SDL_uikitappdelegate.h"
     2.5  #include "SDL_uikitmodes.h"
     2.6  #include "../../events/SDL_events_c.h"
     2.7 -#include "jumphack.h"
     2.8  
     2.9  #ifdef main
    2.10  #undef main
     3.1 --- a/src/video/uikit/SDL_uikitevents.m	Wed Jun 05 21:38:54 2013 -0700
     3.2 +++ b/src/video/uikit/SDL_uikitevents.m	Wed Jun 05 21:47:49 2013 -0700
     3.3 @@ -44,39 +44,24 @@
     3.4      if (!UIKit_EventPumpEnabled)
     3.5          return;
     3.6  
     3.7 -    /*
     3.8 -        When the user presses the 'home' button on the iPod
     3.9 -        the application exits -- immediatly.
    3.10 +    /* Let the run loop run for a short amount of time: long enough for
    3.11 +       touch events to get processed (which is important to get certain
    3.12 +       elements of Game Center's GKLeaderboardViewController to respond
    3.13 +       to touch input), but not long enough to introduce a significant
    3.14 +       delay in the rest of the app.
    3.15 +    */
    3.16 +    const CFTimeInterval seconds = 0.000002;
    3.17  
    3.18 -        Unlike in Mac OS X, it appears there is no way to cancel the termination.
    3.19 +    /* Pump most event types. */
    3.20 +    SInt32 result;
    3.21 +    do {
    3.22 +        result = CFRunLoopRunInMode(kCFRunLoopDefaultMode, seconds, TRUE);
    3.23 +    } while (result == kCFRunLoopRunHandledSource);
    3.24  
    3.25 -        This doesn't give the SDL user's application time to respond to an SDL_Quit event.
    3.26 -        So what we do is that in the UIApplicationDelegate class (SDLUIApplicationDelegate),
    3.27 -        when the delegate receives the ApplicationWillTerminate message, we execute
    3.28 -        a longjmp statement to get back here, preventing an immediate exit.
    3.29 -     */
    3.30 -    if (setjmp(*jump_env()) == 0) {
    3.31 -        /* if we're setting the jump, rather than jumping back */
    3.32 -
    3.33 -        /* Let the run loop run for a short amount of time: long enough for
    3.34 -           touch events to get processed (which is important to get certain
    3.35 -           elements of Game Center's GKLeaderboardViewController to respond
    3.36 -           to touch input), but not long enough to introduce a significant
    3.37 -           delay in the rest of the app.
    3.38 -        */
    3.39 -        const CFTimeInterval seconds = 0.000002;
    3.40 -
    3.41 -        /* Pump most event types. */
    3.42 -        SInt32 result;
    3.43 -        do {
    3.44 -            result = CFRunLoopRunInMode(kCFRunLoopDefaultMode, seconds, TRUE);
    3.45 -        } while (result == kCFRunLoopRunHandledSource);
    3.46 -
    3.47 -        /* Make sure UIScrollView objects scroll properly. */
    3.48 -        do {
    3.49 -            result = CFRunLoopRunInMode((CFStringRef)UITrackingRunLoopMode, seconds, TRUE);
    3.50 -        } while(result == kCFRunLoopRunHandledSource);
    3.51 -    }
    3.52 +    /* Make sure UIScrollView objects scroll properly. */
    3.53 +    do {
    3.54 +        result = CFRunLoopRunInMode((CFStringRef)UITrackingRunLoopMode, seconds, TRUE);
    3.55 +    } while(result == kCFRunLoopRunHandledSource);
    3.56  }
    3.57  
    3.58  #endif /* SDL_VIDEO_DRIVER_UIKIT */
     4.1 --- a/src/video/uikit/jumphack.c	Wed Jun 05 21:38:54 2013 -0700
     4.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     4.3 @@ -1,19 +0,0 @@
     4.4 -/*
     4.5 - *  jumphack.c
     4.6 - *  SDLiPhoneOS
     4.7 - *
     4.8 - */
     4.9 -
    4.10 -#include "jumphack.h"
    4.11 -
    4.12 -/* see SDL_uikitevents.m for more info */
    4.13 -
    4.14 -/* stores the information we need to jump back */
    4.15 -jmp_buf env;
    4.16 -
    4.17 -/* returns the jump environment for setting / getting purposes */
    4.18 -jmp_buf *
    4.19 -jump_env(void)
    4.20 -{
    4.21 -    return &env;
    4.22 -}
     5.1 --- a/src/video/uikit/jumphack.h	Wed Jun 05 21:38:54 2013 -0700
     5.2 +++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
     5.3 @@ -1,18 +0,0 @@
     5.4 -/*
     5.5 - *  jumphack.h
     5.6 - *  SDLiPhoneOS
     5.7 - *
     5.8 - */
     5.9 -
    5.10 -#ifndef _jumphack_h
    5.11 -#define _jumphack_h
    5.12 -
    5.13 -#include "setjmp.h"
    5.14 -
    5.15 -/* see SDL_uikitevents.m for more info */
    5.16 -
    5.17 -extern jmp_buf *jump_env(void);
    5.18 -
    5.19 -#endif
    5.20 -
    5.21 -/* vi: set ts=4 sw=4 expandtab: */