]> git.decadent.org.uk Git - videolink.git/blob - xpcom_support.hpp
Imported version 0.1
[videolink.git] / xpcom_support.hpp
1 // Copyright 2005 Ben Hutchings <ben@decadentplace.org.uk>.
2 // See the file "COPYING" for licence details.
3
4 #ifndef INC_XPCOM_SUPPORT_HPP
5 #define INC_XPCOM_SUPPORT_HPP
6
7 #include <stdexcept>
8
9 #include <nsError.h>
10
11 namespace xpcom_support
12 {
13     void throw_exception(nsresult error);
14
15     inline nsresult check(nsresult result)
16     {
17         if (NS_FAILED(result))
18             throw_exception(result);
19         return result;
20     }
21 }
22
23 #endif // !INC_XPCOM_SUPPORT_HPP