Provide container_of when the bundled SLIRP code needs it, and avoid
redeclaring the libc index function on Unix hosts that expose it.
# include <stdint.h>
#endif
+#ifndef container_of
+#define container_of(address, type, field) ((type *)((char *)(address) - (uintptr_t)(&((type *)0)->field)))
+#endif
+
#ifdef NEED_TYPEDEFS
typedef char int8_t;
typedef unsigned char u_int8_t;
/* Define if you have index() */
#undef HAVE_INDEX
+#ifndef _WIN32
+#define HAVE_INDEX
+#endif
/* Define if you have bcmp() */
#undef HAVE_BCMP