aboutsummaryrefslogtreecommitdiffstats
path: root/sockets.c
diff options
context:
space:
mode:
authorJack Palevich <jackpal@google.com>2009-09-15 15:46:33 -0700
committerJack Palevich <jackpal@google.com>2009-09-15 15:46:33 -0700
commitb489a9b96d5a024e1514258807f5d65ba1c3fb49 (patch)
treebd39e91833482930392f93f751e566be6dd0f777 /sockets.c
parent5d8f37ad78fc66901af50c762029a501561f3b23 (diff)
downloadexternal_qemu-b489a9b96d5a024e1514258807f5d65ba1c3fb49.zip
external_qemu-b489a9b96d5a024e1514258807f5d65ba1c3fb49.tar.gz
external_qemu-b489a9b96d5a024e1514258807f5d65ba1c3fb49.tar.bz2
Enable sockets.c to compile with GCC 4.4 headers
The GCC 4.4 version of netdb.h moves EAI_NODATA behind a __USE_GNU define, because that feature is not part of the POSIX standard for that header. In order to compile sockets.c without error under GCC 4.4 we explicitly define __USE_GNU and explicitly include netdb.h.
Diffstat (limited to 'sockets.c')
-rw-r--r--sockets.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/sockets.c b/sockets.c
index e9be66f..839b94f 100644
--- a/sockets.c
+++ b/sockets.c
@@ -31,7 +31,14 @@
# include <sys/socket.h>
# include <netinet/in.h>
# include <netinet/tcp.h>
-# include <netdb.h>
+# ifdef __linux__ /* Recent versions of glibc only define EAI_NODATA, which is an
+ extension to the POSIX standard, if __USE_GNU is defined. */
+# define __USE_GNU
+# include <netdb.h>
+# undef __USE_GNU
+# else /* !__linux__ */
+# include <netdb.h>
+# endif /* !__linux__ */
# if HAVE_UNIX_SOCKETS
# include <sys/un.h>
# ifndef UNIX_PATH_MAX