title: How can I conditionally compile native code for node.js based on the node version using node-gyp?
body: <p>I have some C++ code for a node.js module that is written for node 0.8 and its enhanced libuv.  Specifically I am using the uv_mutex_* functions, which don't exist in the libuv included in node 0.6.  I want to conditionally embed pthreads equivalents of these functions, but only when built on the old version.</p>
  
  <p>This should give me a cross-platform build (Windows and Linux) when built on node 0.8 and a functioning Linux version if the node version is 0.6.</p>
  
  <p>Is there a preprocessor #define for the node version?  I can't find one.  The best I can come up with is to do some kludgy stuff in binding.gyp to try to guess the version based on &lt;@(node_root) and somehow massage that into a 'defines' value.  There must be a better way!</p>