Skip to content

Commit 0bdd79a

Browse files
author
Junio C Hamano
committed
Undef DT_* before redefining them.
When overriding DT_* macro detection with NO_D_TYPE_IN_DIRENT (recent Cygwin build problem, which hopefully is already fixed in their CVS snapshot version), we define DTYPE() macro to return just "we do not know", but still needed to use DT_* macro to avoid ifdef in the code we use them. If the platform defines DT_* macro but with unusable d_type, this would have resulted in us redefining these preprocessor symbols. Admittedly, that would be just a couple of compilation warnings, and on Cygwin at least this particular problem is transitory (the problem is already fixed in their CVS snapshot version), so this is a low priority fix. Signed-off-by: Junio C Hamano <junkio@cox.net>
1 parent 5df9140 commit 0bdd79a

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

cache.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,10 @@
1313
#if defined(DT_UNKNOWN) && !NO_D_TYPE_IN_DIRENT
1414
#define DTYPE(de) ((de)->d_type)
1515
#else
16+
#undef DT_UNKNOWN
17+
#undef DT_DIR
18+
#undef DT_REG
19+
#undef DT_LNK
1620
#define DT_UNKNOWN 0
1721
#define DT_DIR 1
1822
#define DT_REG 2

0 commit comments

Comments
 (0)