From 032f651824869c429cc24fbd9f7a23e84ed34b1f Mon Sep 17 00:00:00 2001 From: Ryan Dahl Date: Mon, 10 May 2010 16:05:42 -0700 Subject: [PATCH] Check for strings.h --- src/node.cc | 7 ++++++- src/node_buffer.cc | 8 +++++++- src/node_child_process.cc | 7 ++++++- src/node_crypto.cc | 6 +++++- src/node_events.cc | 8 ++++++-- src/node_file.cc | 7 ++++++- src/node_net2.cc | 6 +++++- src/node_stat_watcher.cc | 6 +++++- src/node_stdio.cc | 6 +++++- wscript | 2 ++ 10 files changed, 53 insertions(+), 10 deletions(-) diff --git a/src/node.cc b/src/node.cc index 0fb925d648..bfb481e75e 100644 --- a/src/node.cc +++ b/src/node.cc @@ -5,7 +5,6 @@ #include #include -#include #include /* PATH_MAX */ #include #include @@ -14,6 +13,12 @@ #include #include /* setuid, getuid */ +#ifdef HAVE_STRINGS_H +# include +#else +# include +#endif + #include #include #include diff --git a/src/node_buffer.cc b/src/node_buffer.cc index d757b9623c..bae738bf63 100644 --- a/src/node_buffer.cc +++ b/src/node_buffer.cc @@ -4,7 +4,13 @@ #include // malloc, free #include -#include // memcpy +// memcpy +#ifdef HAVE_STRINGS_H +# include +#else +# include +#endif + #include // htons, htonl diff --git a/src/node_child_process.cc b/src/node_child_process.cc index 6c84514e14..d240d6fbf7 100644 --- a/src/node_child_process.cc +++ b/src/node_child_process.cc @@ -3,7 +3,6 @@ #include #include -#include #include #include #include @@ -13,6 +12,12 @@ #include #endif +#ifdef HAVE_STRINGS_H +# include +#else +# include +#endif + extern char **environ; namespace node { diff --git a/src/node_crypto.cc b/src/node_crypto.cc index 284ae4996d..50519b4279 100644 --- a/src/node_crypto.cc +++ b/src/node_crypto.cc @@ -4,7 +4,11 @@ #include #include -#include +#ifdef HAVE_STRINGS_H +# include +#else +# include +#endif #include #include diff --git a/src/node_events.cc b/src/node_events.cc index c43225a528..4148ea010f 100644 --- a/src/node_events.cc +++ b/src/node_events.cc @@ -3,14 +3,18 @@ #include #include -#include -#include #include #include #include #include /* inet_ntop */ #include /* sockaddr_in, sockaddr_in6 */ +#ifdef HAVE_STRINGS_H +# include +#else +# include +#endif + #include #include #include diff --git a/src/node_file.cc b/src/node_file.cc index f9fd27c122..b1cbd9b044 100644 --- a/src/node_file.cc +++ b/src/node_file.cc @@ -10,10 +10,15 @@ #include #include #include -#include #include #include +#ifdef HAVE_STRINGS_H +# include +#else +# include +#endif + /* used for readlink, AIX doesn't provide it */ #ifndef PATH_MAX #define PATH_MAX 4096 diff --git a/src/node_net2.cc b/src/node_net2.cc index 865bf7c506..d9d485ce7a 100644 --- a/src/node_net2.cc +++ b/src/node_net2.cc @@ -4,7 +4,11 @@ #include #include -#include +#ifdef HAVE_STRINGS_H +# include +#else +# include +#endif #include #include diff --git a/src/node_stat_watcher.cc b/src/node_stat_watcher.cc index 88ae9c6940..816ec961ca 100644 --- a/src/node_stat_watcher.cc +++ b/src/node_stat_watcher.cc @@ -2,8 +2,12 @@ #include #include -#include #include +#ifdef HAVE_STRINGS_H +# include +#else +# include +#endif namespace node { diff --git a/src/node_stdio.cc b/src/node_stdio.cc index c27e6f3726..fab00aeeac 100644 --- a/src/node_stdio.cc +++ b/src/node_stdio.cc @@ -3,7 +3,11 @@ #include #include -#include +#ifdef HAVE_STRINGS_H +# include +#else +# include +#endif #include using namespace v8; diff --git a/wscript b/wscript index fb632a67da..fab15b235f 100644 --- a/wscript +++ b/wscript @@ -114,6 +114,8 @@ def configure(conf): conf.env["USE_DEBUG"] = Options.options.debug conf.env["USE_SYSTEM"] = Options.options.system + conf.check_cc(header_name="strings.h") + conf.check(lib='dl', uselib_store='DL') if not sys.platform.startswith("sunos"): conf.env.append_value("CCFLAGS", "-rdynamic")