Skip to content

Instantly share code, notes, and snippets.

@thrimbor
Created October 30, 2018 00:11
Show Gist options
  • Save thrimbor/f917c9476fc787351d812626d3023891 to your computer and use it in GitHub Desktop.
Save thrimbor/f917c9476fc787351d812626d3023891 to your computer and use it in GitHub Desktop.
// Expected output:
// r=0
// r=1
#include <xboxrt/debug.h>
#include <pbkit/pbkit.h>
#include <hal/xbox.h>
#include "stdio.h"
#include <setjmp.h>
void test()
{
jmp_buf buf;
int r = setjmp(buf);
debugPrint("r=%d\n", r);
if (r == 0)
longjmp(buf, 0);
}
void main(void)
{
int i;
switch(pb_init())
{
case 0: break;
default:
XSleep(2000);
XReboot();
return;
}
pb_show_debug_screen();
test();
while(1) {
XSleep(2000);
}
pb_kill();
XReboot();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment