node.native icon indicating copy to clipboard operation
node.native copied to clipboard

Include in multiple files of a large application

Open diamantisk opened this issue 10 years ago • 0 comments

Recently i tried to include the native.h in multiple files in my project. It seems tha guard headers didnt their job, resulting compiling errors like below:

hlrfrwdr/httpserver.o: In function native::base::_delete_handle(uv_handle_s*)': /opt/node.native/./native/handle.h:71: multiple definition ofnative::base::_delete_handle(uv_handle_s*)' /tmp/cctxhz6O.o:/opt/node.native/./native/handle.h:71: first defined here

I managed to solve these errors by myself by defining such plain functions as inline functions in order to be able to include the native, many times in the same project (since the guard headers -ifndef etc arent enough).

My question is: this is the correct way for solving this? And if true, it would be perfect if you define these as inline these functions also in node.native project here in github.

diamantisk avatar Sep 29 '14 12:09 diamantisk