Skip to content

Instantly share code, notes, and snippets.

@pgriess
Created September 10, 2010 21:00
Show Gist options
  • Save pgriess/574365 to your computer and use it in GitHub Desktop.
Save pgriess/574365 to your computer and use it in GitHub Desktop.
#define SET_CONST(target, e) \
(target)->Set( \
v8::String::NewSymbol(#e), \
v8::Integer::New(e), \
(v8::PropertyAttribute) (v8::ReadOnly | v8::DontDelete) \
)
...
#ifdef EREMOTE
SET_CONST(target, EREMOTE);
#endif
#ifdef EBADRPC
SET_CONST(target, EBADRPC);
#endif
#ifdef ERPCMISMATCH
SET_CONST(target, ERPCMISMATCH);
#endif
#ifdef EPROGUNAVAIL
SET_CONST(target, EPROGUNAVAIL);
#endif
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment