diff --git a/configure.in b/configure.in index cf9a3ca7252b2d8a48ea892e131a1095a6d8a29d..d13c3f2ab794304279dc1b085ce5bf43ef8ecc6b 100644 --- a/configure.in +++ b/configure.in @@ -64,7 +64,7 @@ dnl Availability of various common functions (non-fatal if missing). AC_CHECK_FUNCS([regexec]) dnl Availability of various common headers (non-fatal if missing). -AC_CHECK_HEADERS(paths.h) +AC_CHECK_HEADERS([paths.h sys/syslimits.h]) dnl Specific dir for HTML output ? AC_ARG_WITH(html-dir, AC_HELP_STRING([--with-html-dir=path], diff --git a/src/internal.h b/src/internal.h index ad42a6a438a9cf5b15333af3712f83db8055394b..3fc111634ffda37ae6f8a8b26e5fcbde226641fe 100644 --- a/src/internal.h +++ b/src/internal.h @@ -12,6 +12,23 @@ #include #include #include +#ifdef HAVE_SYS_SYSLIMITS_H +#include +#endif + +/* On architectures which lack these limits, define them (ie. Cygwin). + * Note that the libvirt code should be robust enough to handle the + * case where actual value is longer than these limits (eg. by setting + * length correctly in second argument to gethostname and by always + * using strncpy instead of strcpy). + */ +#ifndef HOST_NAME_MAX +#define HOST_NAME_MAX 256 +#endif + +#ifndef IF_NAMESIZE +#define IF_NAMESIZE 16 +#endif #include "hash.h" #include "libvirt/libvirt.h" diff --git a/src/xml.c b/src/xml.c index 1866ec27a1207ee5e6ea25b1e3e3f3e3509f850e..b2bee98d127dffa812d01b8627511d762592368e 100644 --- a/src/xml.c +++ b/src/xml.c @@ -8,12 +8,15 @@ * Daniel Veillard */ +#include "config.h" + #include "libvirt/libvirt.h" #include #include #include #include +#include #ifdef WITH_XEN #include #endif