d5 / node.native

C++11 port for the Node: native performance and modern simplicity.
MIT License
1.16k stars 149 forks source link

compiler error under mac os x #18

Closed dennycd closed 11 years ago

dennycd commented 11 years ago

There seems to be a compiler error I encountered under mac os x mountain lion.

./native/stream.h:79:60: error: non-constant-expression cannot be narrowed from type 'int' to 'size_t' (aka 'unsigned long') in initializer list [-Wc++11-narrowing] uv_buf_t bufs[] = { uv_buf_t { const_cast<char*>(buf), len } };

I believe this is something specific to the clang compiler. It seems adding static_const(len) would force an explicit type conversion and get rid of the error.

I am using the master branch code