  #include <string.h>
  #include <ctype.h>
  #include <errno.h>
+@@ -62,6 +64,40 @@
+ #include <fontconfig/fcprivate.h>
+ #include "fcdeprecate.h"
+ 
++#ifndef _WIN32
++#include <dirent.h>
++#else
++#include <sys\types.h>
++#include <sys\stat.h>
++#include <direct.h>
++#include <io.h>
++#include <unistd.h>
++#include <windows.h>
++#ifdef _MSC_VER
++#pragma warning (push,1)
++#endif
++#include <winbase.h>
++#ifdef _MSC_VER
++#pragma warning (pop)
++#endif
++# define S_IFDIR  _S_IFDIR                     /* directory */
++#define	S_ISDIR(mode)  (((mode) & S_IFMT) == S_IFDIR)
++#define dirent          _WIN32_FIND_DATAA
++#define d_name          cFileName
++#define d_type          dwFileAttributes
++typedef struct
++{
++    WIN32_FIND_DATAA aDirEnt;
++    HANDLE           h;
++    const char      *p;
++} DIR;
++
++DIR *opendir( const char* pPfad );
++struct dirent *readdir( DIR *pDir );
++
++int closedir( DIR *pDir );
++#endif
++
+ #ifndef FC_CONFIG_PATH
+ #define FC_CONFIG_PATH "fonts.conf"
+ #endif
 --- misc/fontconfig-2.8.0/src/fcxml.c	Mon Jan 19 23:26:36 1970
 +++ misc/build/fontconfig-2.8.0/src/fcxml.c	Mon Jan 19 23:26:36 1970
-@@ -27,6 +27,11 @@
+@@ -27,6 +27,13 @@
  #include <stdarg.h>
++#ifndef _WIN32
  #include <dirent.h>
++#endif
  
 +#ifdef _WIN32
 +#include <io.h>

 
 /* The language is documented in doc/fcformat.fncs
  * These are the features implemented:
--- misc/fontconfig-2.8.0/src/fcint.h	Mon Jan 19 23:26:36 1970
+++ misc/build/fontconfig-2.8.0/src/fcint.h	Mon Jan 19 23:26:36 1970
@@ -31,6 +31,15 @@

 		    cache_dir = test_dir;
--- misc/fontconfig-2.8.0/src/fccfg.c	Mon Jan 19 23:26:36 1970
+++ misc/build/fontconfig-2.8.0/src/fccfg.c	Mon Jan 19 23:26:36 1970
@@ -23,7 +23,9 @@
  */
 
 #include "fcint.h"
+#ifndef _WIN32
 #include <dirent.h>
+#endif
 #include <sys/types.h>
 
 #if defined (_WIN32) && (defined (PIC) || defined (DLL_EXPORT))
@@ -1646,6 +1646,9 @@
 FcConfigFileExists (const FcChar8 *dir, const FcChar8 *file)
 {
