paddybyers / node

evented I/O for v8 javascript
http://nodejs.org/
Other
92 stars 24 forks source link

nameser include handling #4

Open paddybyers opened 13 years ago

paddybyers commented 13 years ago

There are two interrelated issues:

1) There is a lot of include logic relating to inclusion of nameser.h and the arpa variants that is duplicated across multiple files. Any change in the logic - in particular, and change that makes the logic more complex - makes the core progressively less maintainable.

2) There is an implicit assumption in the existing logic that any platform with HAVE_ARPA_NAMESER_H also has HAVE_ARPA_NAMESER_COMPAT_H, and this isn't true on Android (it has nameser.h only).

The suggested fix is to move all of that inclusion logic into one include file, and to adjust the logic to accommodate the Android case.

Proposed changes:

https://github.com/paddybyers/node/commit/dd60885b769f483c121dfad6577b80aeb0aea8b8 https://github.com/paddybyers/node/commit/e30dad0fbeba09fcc3b5feb5533471c7fcc9a420 https://github.com/paddybyers/node/commit/99e081c8630af24c3d1ecbedbc84c698a9ccfe0f

paddybyers commented 13 years ago

I avoided doing this on the master-android branch just by saying that neither arpa include is available.

But .. there's a new problem which is that cares_wrap.cc depends on nameser.h, and this must be the cares substitute if the system does not have the arpa files itself.

There needs to be an ANDROID conditional:

https://github.com/paddybyers/node/commit/f896c852cf15d9c6d085fabe74c8c169c05076f5

And so that this can be seen from the outside, the cares nameser.h needs to be in the include directory, not src:

https://github.com/paddybyers/node/commit/1a5b65dd40aace87d07eb60aa8e9ee41bbfa467f