+/* Socket stuff */
+#ifndef HAVE_INET_PTON
+int inet_pton(int, const char *, void *);
+const char *inet_ntop(int, const void *, char *, int);
+#endif
+
+#ifndef HAVE_STRUCT_POLLFD
+enum
+{
+ POLLIN=1,
+ POLLOUT=2,
+ POLLPRI=4,
+ POLLERR=8, // unsupported stub
+ POLLHUP=16, // unsupported stub
+ POLLNVAL=32 // unsupported stub
+};
+
+struct pollfd
+{
+ int fd;
+ unsigned events;
+ unsigned revents;
+};
+#endif
+#ifndef HAVE_POLL
+struct pollfd;
+int poll (struct pollfd *, unsigned, int);
+#endif
+
+#ifndef HAVE_IF_NAMEINDEX
+#include <errno.h>
+struct if_nameindex
+{
+ unsigned if_index;
+ char *if_name;
+};
+# ifndef HAVE_IF_NAMETOINDEX
+# define if_nametoindex(name) atoi(name)
+# endif
+# define if_nameindex() (errno = ENOBUFS, NULL)
+# define if_freenameindex(list) (void)0
+#endif
+
+/* search.h */
+#ifndef HAVE_SEARCH_H
+typedef struct entry {
+ char *key;
+ void *data;
+} ENTRY;
+
+typedef enum {
+ FIND, ENTER
+} ACTION;
+
+typedef enum {
+ preorder,
+ postorder,
+ endorder,
+ leaf
+} VISIT;
+
+void *tsearch( const void *key, void **rootp, int(*cmp)(const void *, const void *) );
+void *tfind( const void *key, const void **rootp, int(*cmp)(const void *, const void *) );
+void *tdelete( const void *key, void **rootp, int(*cmp)(const void *, const void *) );
+void twalk( const void *root, void(*action)(const void *nodep, VISIT which, int depth) );
+void tdestroy( void *root, void (*free_node)(void *nodep) );
+#else // HAVE_SEARCH_H
+# ifndef HAVE_TDESTROY
+# define tdestroy vlc_tdestroy
+# endif
+#endif
+
+/* Random numbers */
+#ifndef HAVE_NRAND48
+double erand48 (unsigned short subi[3]);
+long jrand48 (unsigned short subi[3]);
+long nrand48 (unsigned short subi[3]);
+#endif
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#ifdef __OS2__
+# undef HAVE_FORK /* Implementation of fork() is imperfect on OS/2 */
+
+struct addrinfo
+{
+ int ai_flags;
+ int ai_family;
+ int ai_socktype;
+ int ai_protocol;
+ size_t ai_addrlen;
+ struct sockaddr *ai_addr;
+ char *ai_canonname;
+ struct addrinfo *ai_next;
+};
+#endif
+
+/* math.h */
+
+#ifndef HAVE_NANF
+#define nanf(tagp) NAN
+#endif
+
+#ifdef _WIN32
+FILE *vlc_win32_tmpfile(void);
+#endif
+