rvagg/nan — pull request #123 by TooTallNate (2014-05-27 04:48:02+00:00)
Title: nan: declare inner callback in `NAN_WEAK_CALLBACK`

Fixes OS X LLVM compiler error:

N_WEAK_CALLBACK(write_object_cb) {
^
../node_modules/nan/nan.h:779:9: note: expanded from macro 'NAN_WEAK_CALLBACK'
_Nan_Weak_Callback_ ## name(wcbd); \
^
:236:1: note: expanded from here
_Nan_Weak_Callback_write_object_cb
^
../src/binding.cc:187:87: note: in instantiation of function template specialization '::write_object_cb' requested here
_NanWeakCallbackInfo* info = NanMakeWeakPersistent(val, user_data, &write_object_cb);
^
../src/binding.cc:150:1: note: '_Nan_Weak_Callback_write_object_cb' should be declared prior to the call site or in an associated namespace of one of its arguments
NAN_WEAK_CALLBACK(write_object_cb) {
^
../node_modules/nan/nan.h:784:28: note: expanded from macro 'NAN_WEAK_CALLBACK'
static NAN_INLINE void _Nan_Weak_Callback_ ## name( \
^
:2:1: note: expanded from here
_Nan_Weak_Callback_write_object_cb
^
1 error generated.

Special thanks to @kkoopa for coming up with the patch.
I'm just submitting it.

See https://github.com/TooTallNate/ref/pull/14 for more details.