root/lang/cplusplus/llv8call/trunk/ext/nspr/nspr-v8.h @ 19856

Revision 19856, 0.6 kB (checked in by tokuhirom, 5 years ago)

nspr things moved to ext/nspr =)

Line 
1#include <nspr/nspr.h>
2#include <iostream>
3#include <sstream>
4
5inline v8::Handle<v8::Value> throw_nspr(const char *header) {
6    v8::HandleScope handle_scope;
7    std::ostringstream e;
8    e << "NSPR ERROR(" << header << "):" << PR_ErrorToString(PR_GetError(), PR_LANGUAGE_I_DEFAULT);
9    return v8::ThrowException(v8::String::New(e.str().c_str()));
10}
11
12inline v8::Handle<v8::Value> throw_nspr() {
13    v8::HandleScope handle_scope;
14    std::ostringstream e;
15    e << "NSPR ERROR:" << PR_ErrorToString(PR_GetError(), PR_LANGUAGE_I_DEFAULT);
16    return v8::ThrowException(v8::String::New(e.str().c_str()));
17}
18
Note: See TracBrowser for help on using the browser.