On Wed, Mar 28, 2012 at 05:56, rhasson <[email protected]> wrote:
> In my code I don't use any namespaces, everything is node:: std:: v8::, etc.
>  However the issue is that the C library I'm building the binding for is
> using a class named "node", I agree they should be using "Node" instead but
> it's something they will need to change.
>
> if I remove the "namespace node" from the node.h and node_object_wrap.h
> files or simply rename it to "nodejs" would it break anything in core?
>  Other modules complied with the original "node" namespace should continue
> to work, I just compile my module with a different namespace a in the header
> files, get the module to work and then change the header files back to
> "node".

That works but it's not necessary. You can wrap the C library's
declarations in a namespace of its own, like this:

  namespace node {
    void foo() { }
  }
  namespace xxx {
    extern "C" struct node { int dummy; };
  }
  int main() {
    xxx::node x;
    node::foo();
  }

> I'll let the library author (FreeLing) know that they should follow better
> naming convention.  Also, is there a chance that within node core, the
> namespace could be changed to "nodejs" from "node" or will that end up
> breaking too many things?

nodejs would, in hindsight, have been the more appropriate namespace
but I'm kind of loath to change that now.

-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

Reply via email to