From 6e522fb27bd7ebf0d0bb7c569e13b1d7e71ddf9e Mon Sep 17 00:00:00 2001 From: Bert Belder Date: Thu, 25 Nov 2010 04:59:52 +0100 Subject: [PATCH] Use the c-ares pton/ntop hack in node_net.cc as well --- src/node_cares.cc | 7 +++++-- src/node_net.cc | 15 +++++++++++++++ 2 files changed, 20 insertions(+), 2 deletions(-) diff --git a/src/node_cares.cc b/src/node_cares.cc index d7d5884556..66a2fe42bd 100644 --- a/src/node_cares.cc +++ b/src/node_cares.cc @@ -24,8 +24,11 @@ # endif #endif // __OpenBSD__ -/* HACK to use inet_pton/inet_ntop from c-ares because mingw32 doesn't have it /* -/* TODO fixme */ +/* + * HACK to use inet_pton/inet_ntop from c-ares because mingw32 doesn't have it /* + * This trick is used in node_net.cc as well + * TODO fixme + */ #ifdef __MINGW32__ extern "C" { # include diff --git a/src/node_net.cc b/src/node_net.cc index 6edf4ee6de..76453b68ef 100644 --- a/src/node_net.cc +++ b/src/node_net.cc @@ -40,6 +40,21 @@ #include #endif +/* + * HACK to use inet_pton/inet_ntop from c-ares because mingw32 doesn't have it /* + * This trick is used in node_ares.cc as well + * TODO fixme + */ +#ifdef __MINGW32__ + extern "C" { +# include +# include + } + +# define inet_pton ares_inet_pton +# define inet_ntop ares_inet_ntop +#endif + #define ARRAY_SIZE(a) (sizeof(a) / sizeof(*(a)))