Alex Riesen [off-list ref] writes:
On 1/20/06, Junio C Hamano [off-list ref] wrote:
quoted
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.
You still have to #undef all the DT_ macros if you have a somewhat old Cygwin
(before Christopher removed the macros).
-
Ah, you mean something like this?
-- >8 --
diff --git a/cache.h b/cache.h
index 8339931..6f13434 100644
--- a/cache.h
+++ b/cache.h
@@ -13,6 +13,10 @@
#if defined(DT_UNKNOWN) && !NO_D_TYPE_IN_DIRENT
#define DTYPE(de) ((de)->d_type)
#else
+#undef DT_UNKNOWN
+#undef DT_DIR
+#undef DT_REG
+#undef DT_LNK
#define DT_UNKNOWN 0
#define DT_DIR 1
#define DT_REG 2
Junio C Hamano, Fri, Jan 20, 2006 20:10:59 +0100:
quoted
quoted
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.
You still have to #undef all the DT_ macros if you have a somewhat
old Cygwin (before Christopher removed the macros).
Ah, you mean something like this?
+#undef DT_UNKNOWN
+#undef DT_DIR
+#undef DT_REG
+#undef DT_LNK
yes, of course
Alex Riesen [off-list ref] writes:
quoted
+#undef DT_UNKNOWN
+#undef DT_DIR
+#undef DT_REG
+#undef DT_LNK
yes, of course
That is technically correct but I suspect it would not matter in
practice. The only thing you are avoiding is four compiler
warnings when compiling for Cygwin of this week (I heard this is
already fixed in Cygwin CVS). On older Cygwin you simply would
not use NO_D_TYPE_IN_DIRENT, since d_type worked before. No?
On 1/21/06, Junio C Hamano [off-list ref] wrote:
Alex Riesen [off-list ref] writes:
quoted
quoted
+#undef DT_UNKNOWN
+#undef DT_DIR
+#undef DT_REG
+#undef DT_LNK
yes, of course
That is technically correct but I suspect it would not matter in
practice. The only thing you are avoiding is four compiler
warnings when compiling for Cygwin of this week (I heard this is
already fixed in Cygwin CVS). On older Cygwin you simply would
not use NO_D_TYPE_IN_DIRENT, since d_type worked before. No?
Yes :)