зеркало из https://github.com/microsoft/git.git
DT_UNKNOWN: do not fully trust existence of DT_UNKNOWN
The recent Cygwin defines DT_UNKNOWN although it does not have d_type in struct dirent. Give an option to tell us not to use d_type on such platforms. Hopefully this problem will be transient. Signed-off-by: Junio C Hamano <junkio@cox.net>
This commit is contained in:
Родитель
35a730f01c
Коммит
63be37b06f
7
Makefile
7
Makefile
|
@ -21,6 +21,9 @@ all:
|
||||||
#
|
#
|
||||||
# Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
|
# Define NO_D_INO_IN_DIRENT if you don't have d_ino in your struct dirent.
|
||||||
#
|
#
|
||||||
|
# Define NO_D_TYPE_IN_DIRENT if your platform defines DT_UNKNOWN but lacks
|
||||||
|
# d_type in struct dirent (latest Cygwin -- will be fixed soonish).
|
||||||
|
#
|
||||||
# Define NO_STRCASESTR if you don't have strcasestr.
|
# Define NO_STRCASESTR if you don't have strcasestr.
|
||||||
#
|
#
|
||||||
# Define NO_SETENV if you don't have setenv in the C library.
|
# Define NO_SETENV if you don't have setenv in the C library.
|
||||||
|
@ -236,6 +239,7 @@ ifeq ($(uname_S),SunOS)
|
||||||
ALL_CFLAGS += -D__EXTENSIONS__
|
ALL_CFLAGS += -D__EXTENSIONS__
|
||||||
endif
|
endif
|
||||||
ifeq ($(uname_O),Cygwin)
|
ifeq ($(uname_O),Cygwin)
|
||||||
|
NO_D_TYPE_IN_DIRENT = YesPlease
|
||||||
NO_D_INO_IN_DIRENT = YesPlease
|
NO_D_INO_IN_DIRENT = YesPlease
|
||||||
NO_STRCASESTR = YesPlease
|
NO_STRCASESTR = YesPlease
|
||||||
NEEDS_LIBICONV = YesPlease
|
NEEDS_LIBICONV = YesPlease
|
||||||
|
@ -337,6 +341,9 @@ ifdef NEEDS_NSL
|
||||||
LIBS += -lnsl
|
LIBS += -lnsl
|
||||||
SIMPLE_LIB += -lnsl
|
SIMPLE_LIB += -lnsl
|
||||||
endif
|
endif
|
||||||
|
ifdef NO_D_TYPE_IN_DIRENT
|
||||||
|
ALL_CFLAGS += -DNO_D_TYPE_IN_DIRENT
|
||||||
|
endif
|
||||||
ifdef NO_D_INO_IN_DIRENT
|
ifdef NO_D_INO_IN_DIRENT
|
||||||
ALL_CFLAGS += -DNO_D_INO_IN_DIRENT
|
ALL_CFLAGS += -DNO_D_INO_IN_DIRENT
|
||||||
endif
|
endif
|
||||||
|
|
2
cache.h
2
cache.h
|
@ -10,7 +10,7 @@
|
||||||
#define deflateBound(c,s) ((s) + (((s) + 7) >> 3) + (((s) + 63) >> 6) + 11)
|
#define deflateBound(c,s) ((s) + (((s) + 7) >> 3) + (((s) + 63) >> 6) + 11)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef DT_UNKNOWN
|
#if defined(DT_UNKNOWN) && !NO_D_TYPE_IN_DIRENT
|
||||||
#define DTYPE(de) ((de)->d_type)
|
#define DTYPE(de) ((de)->d_type)
|
||||||
#else
|
#else
|
||||||
#define DT_UNKNOWN 0
|
#define DT_UNKNOWN 0
|
||||||
|
|
Загрузка…
Ссылка в новой задаче