提交 457d4ad9 编写于 作者: M Matthias Bolte

Fix undefined reference to 'close_used_without_including_unistd_h'

Found while trying to cross-compile libvirt on Fedora 12 for Windows.
gnulib redefines 'close' to 'close_used_without_including_unistd_h'
in sys/socket.h if winsock2.h is present and unistd.h has not been
included before sys/socket.h. Reorder some includes to fix this.
上级 9501a45f
...@@ -25,10 +25,10 @@ ...@@ -25,10 +25,10 @@
#include <config.h> #include <config.h>
#include <unistd.h>
#include <arpa/inet.h> #include <arpa/inet.h>
#include <sys/types.h> #include <sys/types.h>
#include <sys/stat.h> #include <sys/stat.h>
#include <unistd.h>
#include <fcntl.h> #include <fcntl.h>
#include <string.h> #include <string.h>
#include <dirent.h> #include <dirent.h>
......
...@@ -23,10 +23,6 @@ ...@@ -23,10 +23,6 @@
#include <config.h> #include <config.h>
/* Windows socket compatibility functions. */
#include <errno.h>
#include <sys/socket.h>
#include <stdio.h> #include <stdio.h>
#include <stdlib.h> #include <stdlib.h>
#include <unistd.h> #include <unistd.h>
...@@ -37,7 +33,11 @@ ...@@ -37,7 +33,11 @@
#include <sys/stat.h> #include <sys/stat.h>
#include <fcntl.h> #include <fcntl.h>
#ifndef HAVE_WINSOCK2_H /* Unix & Cygwin. */ /* Windows socket compatibility functions. */
#include <errno.h>
#include <sys/socket.h>
#ifndef HAVE_WINSOCK2_H /* Unix & Cygwin. */
# include <sys/un.h> # include <sys/un.h>
# include <net/if.h> # include <net/if.h>
# include <netinet/in.h> # include <netinet/in.h>
......
...@@ -27,6 +27,7 @@ ...@@ -27,6 +27,7 @@
#include "verify.h" #include "verify.h"
#include "internal.h" #include "internal.h"
#include <unistd.h>
#include <sys/select.h> #include <sys/select.h>
#include <sys/types.h> #include <sys/types.h>
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册