File: xpcom_support.hpp

package info (click to toggle)
videolink 1.0-1
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 368 kB
  • ctags: 502
  • sloc: cpp: 3,210; ansic: 880; makefile: 121
file content (23 lines) | stat: -rw-r--r-- 438 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
// Copyright 2005 Ben Hutchings <ben@decadent.org.uk>.
// See the file "COPYING" for licence details.

#ifndef INC_XPCOM_SUPPORT_HPP
#define INC_XPCOM_SUPPORT_HPP

#include <stdexcept>

#include <nsError.h>

namespace xpcom_support
{
    void throw_exception(nsresult error);

    inline nsresult check(nsresult result)
    {
	if (NS_FAILED(result))
	    throw_exception(result);
	return result;
    }
}

#endif // !INC_XPCOM_SUPPORT_HPP