+char *strcasestr (const char *, const char *);
+#endif
+
+#ifndef HAVE_GMTIME_R
+struct tm *gmtime_r (const time_t *, struct tm *);
+#endif
+
+#ifndef HAVE_LOCALTIME_R
+struct tm *localtime_r (const time_t *, struct tm *);
+#endif
+
+#ifndef HAVE_REWIND
+void rewind (FILE *);
+#endif
+
+#ifndef HAVE_GETCWD
+char *getcwd (char *buf, size_t size);
+#endif
+
+#ifndef HAVE_GETPID
+pid_t getpid (void);
+#endif
+
+#ifndef HAVE_STRTOK_R
+char *strtok_r(char *, const char *, char **);
+#endif
+
+#ifdef __cplusplus
+} /* extern "C" */
+#endif
+
+#ifndef HAVE_GETENV
+static inline char *getenv (const char *name)
+{
+ (void)name;
+ return NULL;
+}
+#endif
+
+/* Alignment of critical static data structures */
+#ifdef ATTRIBUTE_ALIGNED_MAX
+# define ATTR_ALIGN(align) __attribute__ ((__aligned__ ((ATTRIBUTE_ALIGNED_MAX < align) ? ATTRIBUTE_ALIGNED_MAX : align)))
+#else
+# define ATTR_ALIGN(align)
+#endif
+
+#ifndef HAVE_USELOCALE
+#define LC_NUMERIC_MASK 0
+typedef void *locale_t;
+static inline locale_t uselocale(locale_t loc)
+{
+ (void)loc;
+ return NULL;
+}
+static inline void freelocale(locale_t loc)
+{
+ (void)loc;
+}
+static inline locale_t newlocale(int mask, const char * locale, locale_t base)
+{
+ (void)mask; (void)locale; (void)base;
+ return NULL;
+}
+#endif
+
+#ifdef WIN32
+# include <dirent.h>
+# define opendir Use_utf8_opendir_or_vlc_wopendir_instead!
+# define readdir Use_utf8_readdir_or_vlc_wreaddir_instead!
+# define closedir vlc_wclosedir
+#endif
+
+/* libintl support */
+#define _(str) vlc_gettext (str)
+#define N_(str) gettext_noop (str)
+#define gettext_noop(str) (str)
+
+#ifndef HAVE_SWAB
+void swab (const void *, void *, ssize_t);
+#endif
+
+#ifndef HAVE_TDESTROY
+typedef void (*__free_fn_t) (void *__nodep);
+void tdestroy (void *vroot, __free_fn_t freefct);
+#endif
+
+/* Socket stuff */
+#ifndef HAVE_INET_PTON
+# define inet_pton vlc_inet_pton
+#endif
+
+#ifndef HAVE_INET_NTOP
+# define inet_ntop vlc_inet_ntop
+#endif
+
+#ifndef HAVE_POLL
+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;
+};
+
+# define poll(a, b, c) vlc_poll(a, b, c)