Guard dirent.h includes

Might not be available on Windows.
This commit is contained in:
Tim-Philipp Müller 2020-07-18 17:21:09 +01:00
parent 9bc88933b2
commit 03aa12c75e
7 changed files with 15 additions and 1 deletions

View File

@ -157,7 +157,7 @@ dnl ==========================================================================
# Checks for header files.
AC_HEADER_DIRENT
AC_HEADER_STDC
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h sys/statvfs.h sys/vfs.h sys/statfs.h sys/param.h sys/mount.h])
AC_CHECK_HEADERS([dirent.h fcntl.h stdlib.h string.h unistd.h sys/statvfs.h sys/vfs.h sys/statfs.h sys/param.h sys/mount.h])
AX_CREATE_STDINT_H([src/fcstdint.h])
# Checks for typedefs, structures, and compiler characteristics.

View File

@ -41,7 +41,9 @@
#include <sys/stat.h>
#include <errno.h>
#include <fcntl.h>
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
#include <string.h>
#include <locale.h>

View File

@ -25,7 +25,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
#include <string.h>
#include <limits.h>
#include <sys/types.h>

View File

@ -25,7 +25,9 @@
/* Objects MT-safe for readonly access. */
#include "fcint.h"
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
#include <sys/types.h>
#if defined (_WIN32) && !defined (R_OK)

View File

@ -23,7 +23,10 @@
*/
#include "fcint.h"
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
FcBool
FcFileIsDir (const FcChar8 *file)

View File

@ -22,7 +22,9 @@
*/
#include "fcint.h"
#include "fcarch.h"
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
#include <limits.h>
#include <sys/types.h>
#include <sys/stat.h>

View File

@ -26,7 +26,10 @@
#include "fcint.h"
#include <fcntl.h>
#include <stdarg.h>
#ifdef HAVE_DIRENT_H
#include <dirent.h>
#endif
#ifdef ENABLE_LIBXML2