#ifndef HAVE_SCANDIR
# define scandir vlc_scandir
# define alphasort vlc_alphasort
+ struct dirent;
VLC_EXPORT( int, vlc_scandir, ( const char *name, struct dirent ***namelist, int (*filter) ( const struct dirent * ), int (*compar) ( const struct dirent **, const struct dirent ** ) ) );
VLC_EXPORT( int, vlc_alphasort, ( const struct dirent **a, const struct dirent **b ) );
#elif !defined(__PLUGIN__)
# include <iconv.h>
#endif
+#ifdef HAVE_DIRENT_H
+# include <dirent.h>
+#endif
+
/*****************************************************************************
* getenv: just in case, but it should never be called
*****************************************************************************/