]> git.decadent.org.uk Git - videolink.git/blob - xpcom_support.hpp
Added workaround for XULRunner 1.9's requirement of 16-bit wchar_t. Changing the...
[videolink.git] / xpcom_support.hpp
1 // Copyright 2005 Ben Hutchings <ben@decadent.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 "wchar_t_short.h"
10 #include <nsError.h>
11 #include "wchar_t_default.h"
12
13 namespace xpcom_support
14 {
15     void throw_exception(nsresult error);
16
17     inline nsresult check(nsresult result)
18     {
19         if (NS_FAILED(result))
20             throw_exception(result);
21         return result;
22     }
23 }
24
25 #endif // !INC_XPCOM_SUPPORT_HPP