Logo Search packages:      
Sourcecode: mingw-w64 version File versions  Download package

t_setjmp.c
#include <stdio.h>
#include <setjmp.h>

jmp_buf buf;

void foo (void)
{
  printf ("Call longjmp\n");
  longjmp (buf, 1);
}

int main ()
{
  if (setjmp (buf))
    {
      printf ("Caught\n");
    }
  else
    {
      foo ();
      printf ("Should not be reached.\n");
      return 1;
    }
  return 0;
}

Generated by  Doxygen 1.6.0   Back to index