* configure.in, src/internal.h, src/xml.c: <sys/syslimits.h>
is needed on Cygwin to get PATH_MAX. HOST_NAME_MAX and
IF_NAMESIZE defined if not in header files.
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],
#include <netinet/in.h>
#include <netinet/tcp.h>
#include <libxml/threads.h>
+#ifdef HAVE_SYS_SYSLIMITS_H
+#include <sys/syslimits.h>
+#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"
* Daniel Veillard <veillard@redhat.com>
*/
+#include "config.h"
+
#include "libvirt/libvirt.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <stdarg.h>
+#include <limits.h>
#ifdef WITH_XEN
#include <xs.h>
#endif