diff options
Diffstat (limited to 'test/lib/exceptions.h')
-rw-r--r-- | test/lib/exceptions.h | 42 |
1 files changed, 0 insertions, 42 deletions
diff --git a/test/lib/exceptions.h b/test/lib/exceptions.h deleted file mode 100644 index 8b98d5b..0000000 --- a/test/lib/exceptions.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - * This file is part of libdom test suite. - * Licensed under the MIT License, - * http://www.opensource.org/licenses/mit-license.php - * Copyright 2007 James Shaw <jshaw@netsurf-browser.org> - */ - -#ifndef exceptions_h_ -#define exceptions_h_ - -#include <setjmp.h> - -#include <dom/core/exceptions.h> - -/* Adapted from http://www.math.princeton.edu/~asnowden/c-except.html - Usage: - TRY - THROW(DOM_NOT_FOUND_ERR); - THROW_IF_ERR(dom_document_get_doctype(...)); - CATCH(ex) - printf("exception: %d\n", ex); - ENDTRY -*/ -#define TRY __exvalue=setjmp(__exbuf); \ - if (__exvalue==0) { -#define CATCH(x) } else { \ - int x = __exvalue; -#define ENDTRY } -#define THROW(x) longjmp(__exbuf, x) - -#define THROW_IF_ERR(x) \ - do { \ - int err = x; \ - if (err != DOM_NO_ERR) \ - THROW(err); \ - } while (0) - -jmp_buf __exbuf; -int __exvalue; - -#endif - |