diff --git a/ChangeLog b/ChangeLog index 65f705e0..96990ba4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2010-04-12 Tatsuhiro Tsujikawa + + Fixed compile error on opensolaris + * configure.ac + * src/Logger.h + * src/GZipEncoder.h + 2010-04-11 Tatsuhiro Tsujikawa Added aria2.pauseAll, aria2.forcePauseAll and aria2.unpauseAll diff --git a/configure b/configure index e5aa36ef..d0a39707 100755 --- a/configure +++ b/configure @@ -7488,6 +7488,67 @@ if test "$ac_res" != no; then : fi +case "$target" in + *solaris*) + { $as_echo "$as_me:${as_lineno-$LINENO}: checking for library containing getaddrinfo" >&5 +$as_echo_n "checking for library containing getaddrinfo... " >&6; } +if test "${ac_cv_search_getaddrinfo+set}" = set; then : + $as_echo_n "(cached) " >&6 +else + ac_func_search_save_LIBS=$LIBS +cat confdefs.h - <<_ACEOF >conftest.$ac_ext +/* end confdefs.h. */ + +/* Override any GCC internal prototype to avoid an error. + Use char because int might match the return type of a GCC + builtin and then its argument prototype would still apply. */ +#ifdef __cplusplus +extern "C" +#endif +char getaddrinfo (); +int +main () +{ +return getaddrinfo (); + ; + return 0; +} +_ACEOF +for ac_lib in '' socket; do + if test -z "$ac_lib"; then + ac_res="none required" + else + ac_res=-l$ac_lib + LIBS="-l$ac_lib $ac_func_search_save_LIBS" + fi + if ac_fn_cxx_try_link "$LINENO"; then : + ac_cv_search_getaddrinfo=$ac_res +fi +rm -f core conftest.err conftest.$ac_objext \ + conftest$ac_exeext + if test "${ac_cv_search_getaddrinfo+set}" = set; then : + break +fi +done +if test "${ac_cv_search_getaddrinfo+set}" = set; then : + +else + ac_cv_search_getaddrinfo=no +fi +rm conftest.$ac_ext +LIBS=$ac_func_search_save_LIBS +fi +{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_search_getaddrinfo" >&5 +$as_echo "$ac_cv_search_getaddrinfo" >&6; } +ac_res=$ac_cv_search_getaddrinfo +if test "$ac_res" != no; then : + test "$ac_res" = "none required" || LIBS="$ac_res $LIBS" + +fi + + ;; +esac + # Checks for header files. # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works # for constant arguments. Useless! diff --git a/configure.ac b/configure.ac index f1ea59fc..efce533f 100644 --- a/configure.ac +++ b/configure.ac @@ -210,6 +210,12 @@ AM_CONDITIONAL([HAVE_SQLITE3], [test "x$have_sqlite3" = "xyes"]) AC_SEARCH_LIBS([clock_gettime], [rt]) +case "$target" in + *solaris*) + AC_SEARCH_LIBS([getaddrinfo], [socket]) + ;; +esac + # Checks for header files. AC_FUNC_ALLOCA AC_HEADER_STDC diff --git a/src/GZipEncoder.h b/src/GZipEncoder.h index 4336b271..66f4451a 100644 --- a/src/GZipEncoder.h +++ b/src/GZipEncoder.h @@ -34,6 +34,7 @@ /* copyright --> */ #ifndef _D_GZIP_ENCODER_H_ #define _D_GZIP_ENCODER_H_ +#include "common.h" #include diff --git a/src/Logger.h b/src/Logger.h index f4e349af..216a29cf 100644 --- a/src/Logger.h +++ b/src/Logger.h @@ -72,7 +72,7 @@ private: int _stdoutField; - inline bool levelEnabled(LEVEL level) const + inline bool levelEnabled(LEVEL level) { return (level >= _logLevel && _file.is_open()) || _stdoutField&level; } @@ -195,12 +195,12 @@ public: // Returns true if this logger actually writes debug log message to // either file or stdout. - bool debug() const + bool debug() { return levelEnabled(DEBUG); } - bool info() const + bool info() { return levelEnabled(INFO); }