mirror of
https://github.com/git/git
synced 2024-09-17 23:41:33 +00:00
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>
This commit is contained in:
parent
5df9140c92
commit
0bdd79af62
4
cache.h
4
cache.h
|
@ -13,6 +13,10 @@
|
||||||
#if defined(DT_UNKNOWN) && !NO_D_TYPE_IN_DIRENT
|
#if defined(DT_UNKNOWN) && !NO_D_TYPE_IN_DIRENT
|
||||||
#define DTYPE(de) ((de)->d_type)
|
#define DTYPE(de) ((de)->d_type)
|
||||||
#else
|
#else
|
||||||
|
#undef DT_UNKNOWN
|
||||||
|
#undef DT_DIR
|
||||||
|
#undef DT_REG
|
||||||
|
#undef DT_LNK
|
||||||
#define DT_UNKNOWN 0
|
#define DT_UNKNOWN 0
|
||||||
#define DT_DIR 1
|
#define DT_DIR 1
|
||||||
#define DT_REG 2
|
#define DT_REG 2
|
||||||
|
|
Loading…
Reference in a new issue