+#ifndef HAVE_STRCASESTR
+# ifndef HAVE_STRISTR
+# define strcasestr vlc_strcasestr
+ VLC_EXPORT( char *, vlc_strcasestr, ( const char *s1, const char *s2 ) );
+# else
+# define strcasestr stristr
+# if !defined(__PLUGIN__)
+# define vlc_strcasestr NULL
+# endif
+# endif
+#elif !defined(__PLUGIN__)
+# define vlc_strcasestr NULL
+#endif
+
+#ifndef HAVE_DIRENT_H
+ typedef void DIR;
+# ifndef FILENAME_MAX
+# define FILENAME_MAX (260)
+# endif
+ struct dirent
+ {
+ long d_ino; /* Always zero. */
+ unsigned short d_reclen; /* Always zero. */
+ unsigned short d_namlen; /* Length of name in d_name. */
+ char d_name[FILENAME_MAX]; /* File name. */
+ };
+# define opendir vlc_opendir
+# define readdir vlc_readdir
+# define closedir vlc_closedir
+# define rewinddir vlc_rewindir
+# define seekdir vlc_seekdir
+# define telldir vlc_telldir
+ VLC_EXPORT( void *, vlc_opendir, ( const char * ) );
+ VLC_EXPORT( void *, vlc_readdir, ( void * ) );
+ VLC_EXPORT( int, vlc_closedir, ( void * ) );
+ VLC_INTERNAL( void, vlc_rewinddir, ( void * ) );
+ VLC_INTERNAL( void, vlc_seekdir, ( void *, long ) );
+ VLC_INTERNAL( long, vlc_telldir, ( void * ) );
+#else
+ struct dirent; /* forward declaration for vlc_symbols.h */
+# if !defined(__PLUGIN__)
+# define vlc_opendir NULL
+# define vlc_readdir NULL
+# define vlc_closedir NULL
+# endif
+#endif
+
+#if defined (WIN32)
+# include <dirent.h>
+VLC_INTERNAL( void *, vlc_wopendir, ( const wchar_t * ) );
+VLC_INTERNAL( struct _wdirent *, vlc_wreaddir, ( void * ) );
+VLC_EXPORT( int, vlc_wclosedir, ( void * ) );
+VLC_INTERNAL( void, vlc_rewinddir, ( void * ) );
+VLC_INTERNAL( void, vlc_seekdir, ( void *, long ) );
+VLC_INTERNAL( long, vlc_telldir, ( void * ) );
+# define opendir Use_utf8_opendir_or_vlc_wopendir_instead!
+# define readdir Use_utf8_readdir_or_vlc_wreaddir_instead!
+# define closedir vlc_wclosedir
+# define _wopendir vlc_wopendir
+# define _wreaddir vlc_wreaddir
+# define _wclosedir vlc_wclosedir
+# define rewinddir vlc_rewinddir
+# define seekdir vlc_seekdir
+# define telldir vlc_telldir
+#elif !defined(__PLUGIN__)
+# define vlc_wclosedir NULL
+#endif
+