fccompat: fix build on Windows without unistd.h

https://docs.microsoft.com/en-us/cpp/c-runtime-library/reference/access-waccess?view=vs-2019
This commit is contained in:
Tim-Philipp Müller 2020-07-07 03:48:34 +00:00 committed by Akira TAGOH
parent 97d709e888
commit a30e4db967
17 changed files with 70 additions and 13 deletions

View File

@ -34,7 +34,9 @@
#include <fontconfig/fontconfig.h>
#include <stdio.h>
#include <stdlib.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>

View File

@ -36,7 +36,9 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <sys/types.h>
#include <sys/stat.h>
#include <errno.h>

View File

@ -35,7 +35,9 @@
#include <fontconfig/fontconfig.h>
#include <stdio.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stdlib.h>
#include <string.h>
#include <locale.h>

View File

@ -24,7 +24,6 @@
#include <fontconfig/fontconfig.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
@ -37,6 +36,10 @@
#define HAVE_GETOPT 1
#endif
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef ENABLE_NLS
#include <libintl.h>
#define _(x) (dgettext(GETTEXT_PACKAGE, x))

View File

@ -33,11 +33,14 @@
#include <fontconfig/fontconfig.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef ENABLE_NLS
#include <libintl.h>
#define _(x) (dgettext(GETTEXT_PACKAGE, x))

View File

@ -33,11 +33,14 @@
#include <fontconfig/fontconfig.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef ENABLE_NLS
#include <libintl.h>
#define _(x) (dgettext(GETTEXT_PACKAGE, x))

View File

@ -36,11 +36,14 @@
#include <fontconfig/fontconfig.h>
#include <fontconfig/fcfreetype.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef ENABLE_NLS
#include <libintl.h>
#define _(x) (dgettext(GETTEXT_PACKAGE, x))

View File

@ -36,11 +36,14 @@
#include <fontconfig/fontconfig.h>
#include <fontconfig/fcfreetype.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef ENABLE_NLS
#include <libintl.h>
#define _(x) (dgettext(GETTEXT_PACKAGE, x))

View File

@ -36,11 +36,14 @@
#include <fontconfig/fontconfig.h>
#include <fontconfig/fcfreetype.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <string.h>
#include <locale.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef ENABLE_NLS
#include <libintl.h>
#define _(x) (dgettext(GETTEXT_PACKAGE, x))

View File

@ -47,13 +47,20 @@
* held.
*/
#ifdef HAVE_CONFIG_H
#include <config.h>
#endif
#include "fcint.h"
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#include <stdlib.h>
#include <time.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifdef _WIN32
#include <direct.h>
#define mkdir(path,mode) _mkdir(path)

View File

@ -71,6 +71,21 @@
#define FC_O_NOINHERIT 0
#endif
#ifndef HAVE_UNISTD_H
/* Values for the second argument to access. These may be OR'd together. */
#ifndef R_OK
#define R_OK 4 /* Test for read permission. */
#endif
#ifndef W_OK
#define W_OK 2 /* Test for write permission. */
#endif
#ifndef F_OK
#define F_OK 0 /* Test for existence. */
#endif
typedef int mode_t;
#endif /* !HAVE_UNISTD_H */
#if !defined (HAVE_MKOSTEMP) && !defined(HAVE_MKSTEMP) && !defined(HAVE__MKTEMP_S)
static int
mkstemp (char *template)

View File

@ -40,7 +40,9 @@
#include <limits.h>
#include <float.h>
#include <math.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#include <stddef.h>
#include <sys/types.h>
#include <sys/stat.h>

View File

@ -29,8 +29,10 @@
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <unistd.h>
#include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifndef HAVE_STRUCT_DIRENT_D_TYPE
#include <sys/types.h>
#include <sys/stat.h>

View File

@ -29,8 +29,10 @@
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <unistd.h>
#include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifndef HAVE_STRUCT_DIRENT_D_TYPE
#include <sys/types.h>
#include <sys/stat.h>

View File

@ -29,8 +29,10 @@
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <unistd.h>
#include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifndef HAVE_STRUCT_DIRENT_D_TYPE
#include <sys/types.h>
#include <sys/stat.h>

View File

@ -29,8 +29,10 @@
#include <stdlib.h>
#include <string.h>
#include <dirent.h>
#include <unistd.h>
#include <errno.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifndef HAVE_STRUCT_DIRENT_D_TYPE
#include <sys/types.h>
#include <sys/stat.h>

View File

@ -28,13 +28,14 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <sys/types.h>
#include <dirent.h>
#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif
#ifndef HAVE_STRUCT_DIRENT_D_TYPE
#include <sys/types.h>
#include <sys/stat.h>
#include <unistd.h>
#endif
#include <fontconfig/fontconfig.h>