diff options
Diffstat (limited to 'libXfont/src/fontfile/catalogue.c')
-rw-r--r-- | libXfont/src/fontfile/catalogue.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/libXfont/src/fontfile/catalogue.c b/libXfont/src/fontfile/catalogue.c index d49423617..651ebc1a0 100644 --- a/libXfont/src/fontfile/catalogue.c +++ b/libXfont/src/fontfile/catalogue.c @@ -30,8 +30,12 @@ #include <X11/fonts/fntfilst.h> #include <sys/types.h> #include <sys/stat.h> +#ifdef _MSC_VER +#include <direct.h> +#else #include <dirent.h> #include <unistd.h> +#endif static const char CataloguePrefix[] = "catalogue:"; @@ -135,19 +139,24 @@ CatalogueRescan (FontPathElementPtr fpe, Bool forceScan) FontPathElementPtr subfpe; struct stat statbuf; const char *path; +#ifndef _MSC_VER DIR *dir; struct dirent *entry; +#endif int len; int pathlen; path = fpe->name + strlen(CataloguePrefix); - if (stat(path, &statbuf) < 0 || !S_ISDIR(statbuf.st_mode)) + if (stat(path, &statbuf) < 0 || (statbuf.st_mode&_S_IFDIR)) return BadFontPath; if ((forceScan == FALSE) && (statbuf.st_mtime <= cat->mtime)) return Successful; - dir = opendir(path); +#ifdef _MSC_VER +__asm int 3; +#else + dir = opendir(path); if (dir == NULL) { xfree(cat); @@ -221,7 +230,7 @@ CatalogueRescan (FontPathElementPtr fpe, Bool forceScan) } closedir(dir); - +#endif qsort(cat->fpeList, cat->fpeCount, sizeof cat->fpeList[0], ComparePriority); |