1
0
Эх сурвалжийг харах

2010-02-02 Tatsuhiro Tsujikawa <[email protected]>

	Drop legacy ifdef for ares support and code cleanup.
	* src/AsyncNameResolver.cc
	* src/AsyncNameResolver.h
Tatsuhiro Tsujikawa 15 жил өмнө
parent
commit
76aad1de2b

+ 6 - 0
ChangeLog

@@ -1,3 +1,9 @@
+2010-02-02  Tatsuhiro Tsujikawa  <[email protected]>
+
+	Drop legacy ifdef for ares support and code cleanup.
+	* src/AsyncNameResolver.cc
+	* src/AsyncNameResolver.h
+
 2010-02-02  Tatsuhiro Tsujikawa  <[email protected]>
 
 	Call ares_library_init and ares_library_cleanup if they are

+ 3 - 6
src/AsyncNameResolver.cc

@@ -33,10 +33,11 @@
  */
 /* copyright --> */
 #include "AsyncNameResolver.h"
-#include "util.h"
-#include "A2STR.h"
+
 #include <cstring>
 
+#include "A2STR.h"
+
 namespace aria2 {
 
 #ifdef HAVE_LIBCARES1_5
@@ -47,11 +48,7 @@ void callback(void* arg, int status, int timeouts, struct hostent* host)
 {
   AsyncNameResolver* resolverPtr = reinterpret_cast<AsyncNameResolver*>(arg);
   if(status != ARES_SUCCESS) {
-#ifdef HAVE_LIBCARES
     resolverPtr->error = ares_strerror(status);
-#else
-    resolverPtr->error = ares_strerror(status, 0);
-#endif // HAVE_LIBCARES
     resolverPtr->status = AsyncNameResolver::STATUS_ERROR;
     return;
   }

+ 4 - 8
src/AsyncNameResolver.h

@@ -36,18 +36,14 @@
 #define _D_ASYNC_NAME_RESOLVER_H_
 
 #include "common.h"
-#include "SharedHandle.h"
-#include "a2netcompat.h"
+
 #include <string>
 #include <deque>
 
-#ifdef __cplusplus
-extern "C" {
-#endif
 #include <ares.h>
-#ifdef __cplusplus
-} /* end of extern "C" */
-#endif
+
+#include "SharedHandle.h"
+#include "a2netcompat.h"
 
 namespace aria2 {