echo "$ac_t""no" 1>&6
fi
+echo $ac_n "checking for socket in -lsocket""... $ac_c" 1>&6
+echo "configure:723: checking for socket in -lsocket" >&5
+ac_lib_var=`echo socket'_'socket | sed 'y%./+-%__p_%'`
+if eval "test \"`echo '$''{'ac_cv_lib_$ac_lib_var'+set}'`\" = set"; then
+ echo $ac_n "(cached) $ac_c" 1>&6
+else
+ ac_save_LIBS="$LIBS"
+LIBS="-lsocket $LIBS"
+cat > conftest.$ac_ext <<EOF
+#line 731 "configure"
+#include "confdefs.h"
+/* Override any gcc2 internal prototype to avoid an error. */
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char socket();
+
+int main() {
+socket()
+; return 0; }
+EOF
+if { (eval echo configure:742: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest; then
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=yes"
+else
+ echo "configure: failed program was:" >&5
+ cat conftest.$ac_ext >&5
+ rm -rf conftest*
+ eval "ac_cv_lib_$ac_lib_var=no"
+fi
+rm -f conftest*
+LIBS="$ac_save_LIBS"
+
+fi
+if eval "test \"`echo '$ac_cv_lib_'$ac_lib_var`\" = yes"; then
+ echo "$ac_t""yes" 1>&6
+ ac_tr_lib=HAVE_LIB`echo socket | sed -e 's/[^a-zA-Z0-9_]/_/g' \
+ -e 'y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/'`
+ cat >> confdefs.h <<EOF
+#define $ac_tr_lib 1
+EOF
+
+ LIBS="-lsocket $LIBS"
+
+else
+ echo "$ac_t""no" 1>&6
+fi
+
echo $ac_n "checking __attribute__((,,))""... $ac_c" 1>&6
-echo "configure:725: checking __attribute__((,,))" >&5
+echo "configure:772: checking __attribute__((,,))" >&5
if eval "test \"`echo '$''{'adns_cv_c_attribute_supported'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 731 "configure"
+#line 778 "configure"
#include "confdefs.h"
int main() {
extern int testfunction(int x) __attribute__((,,))
; return 0; }
EOF
-if { (eval echo configure:738: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:785: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
adns_cv_c_attribute_supported=yes
else
echo $ac_n "checking __attribute__((noreturn))""... $ac_c" 1>&6
-echo "configure:760: checking __attribute__((noreturn))" >&5
+echo "configure:807: checking __attribute__((noreturn))" >&5
if eval "test \"`echo '$''{'adns_cv_c_attribute_noreturn'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 766 "configure"
+#line 813 "configure"
#include "confdefs.h"
int main() {
extern int testfunction(int x) __attribute__((noreturn))
; return 0; }
EOF
-if { (eval echo configure:773: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:820: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
adns_cv_c_attribute_noreturn=yes
else
echo $ac_n "checking __attribute__((const))""... $ac_c" 1>&6
-echo "configure:800: checking __attribute__((const))" >&5
+echo "configure:847: checking __attribute__((const))" >&5
if eval "test \"`echo '$''{'adns_cv_c_attribute_const'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 806 "configure"
+#line 853 "configure"
#include "confdefs.h"
int main() {
extern int testfunction(int x) __attribute__((const))
; return 0; }
EOF
-if { (eval echo configure:813: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:860: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
adns_cv_c_attribute_const=yes
else
echo $ac_n "checking __attribute__((format...))""... $ac_c" 1>&6
-echo "configure:840: checking __attribute__((format...))" >&5
+echo "configure:887: checking __attribute__((format...))" >&5
if eval "test \"`echo '$''{'adns_cv_attribute_format'+set}'`\" = set"; then
echo $ac_n "(cached) $ac_c" 1>&6
else
cat > conftest.$ac_ext <<EOF
-#line 846 "configure"
+#line 893 "configure"
#include "confdefs.h"
int main() {
extern int testfunction(char *y, ...) __attribute__((format(printf,1,2)))
; return 0; }
EOF
-if { (eval echo configure:853: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
+if { (eval echo configure:900: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>&5; }; then
rm -rf conftest*
adns_cv_attribute_format=yes
else
#include <stdlib.h>
#include <netdb.h>
+#include <sys/socket.h>
+#include <netinet/in.h>
#include <arpa/inet.h>
#include "internal.h"
addr.sin_family= AF_INET;
addr.sin_port= htons(DNS_PORT);
addr.sin_addr= ads->servers[ads->tcpserver].addr;
- r= connect(fd,&addr,sizeof(addr));
+ r= connect(fd,(const struct sockaddr*)&addr,sizeof(addr));
ads->tcpsocket= fd;
ads->tcpstate= server_connecting;
if (r==0) { tcp_connected(ads,now); continue; }
count++;
for (;;) {
udpaddrlen= sizeof(udpaddr);
- r= recvfrom(ads->udpsocket,udpbuf,sizeof(udpbuf),0,&udpaddr,&udpaddrlen);
+ r= recvfrom(ads->udpsocket,udpbuf,sizeof(udpbuf),0,
+ (struct sockaddr*)&udpaddr,&udpaddrlen);
if (r<0) {
if (!(errno == EAGAIN || errno == EWOULDBLOCK ||
errno == EINTR || errno == ENOMEM || errno == ENOBUFS))