1 ################################################################################
5 ## $Date: 2010/03/07 13:15:46 +0100 $
7 ################################################################################
9 ## Version 3.x, Copyright (C) 2004-2010, Marcus Holland-Moritz.
10 ## Version 2.x, Copyright (C) 2001, Paul Marquess.
11 ## Version 1.x, Copyright (C) 1999, Kenneth Albanowski.
13 ## This program is free software; you can redistribute it and/or
14 ## modify it under the same terms as Perl itself.
16 ################################################################################
30 # define dXCPT dJMPENV; int rEtV = 0
31 # define XCPT_TRY_START JMPENV_PUSH(rEtV); if (rEtV == 0)
32 # define XCPT_TRY_END JMPENV_POP;
33 # define XCPT_CATCH if (rEtV != 0)
34 # define XCPT_RETHROW JMPENV_JUMP(rEtV)
36 # define dXCPT Sigjmp_buf oldTOP; int rEtV = 0
37 # define XCPT_TRY_START Copy(top_env, oldTOP, 1, Sigjmp_buf); rEtV = Sigsetjmp(top_env, 1); if (rEtV == 0)
38 # define XCPT_TRY_END Copy(oldTOP, top_env, 1, Sigjmp_buf);
39 # define XCPT_CATCH if (rEtV != 0)
40 # define XCPT_RETHROW Siglongjmp(top_env, rEtV)
46 /* defined in module3.c */
47 int exception(int throw_e);
61 $Devel::PPPort::exception_caught = undef;
63 $rv = eval { &Devel::PPPort::exception(0) };
67 ok($Devel::PPPort::exception_caught, 0);
69 $Devel::PPPort::exception_caught = undef;
71 $rv = eval { &Devel::PPPort::exception(1) };
74 ok($Devel::PPPort::exception_caught, 1);