Randomly placed definition of S_ISDIR() in psql/copy.c - Mailing list pgsql-hackers

From Tom Lane
Subject Randomly placed definition of S_ISDIR() in psql/copy.c
Date
Msg-id 25175.1240691721@sss.pgh.pa.us
Whole thread Raw
Responses Re: Randomly placed definition of S_ISDIR() in psql/copy.c  (David Fetter <david@fetter.org>)
Re: Randomly placed definition of S_ISDIR() in psql/copy.c  (Magnus Hagander <magnus@hagander.net>)
List pgsql-hackers
Why does psql/copy.c contain this?

#if defined(WIN32) && !defined(S_ISDIR)
#define __S_ISTYPE(mode, mask)    (((mode) & S_IFMT) == (mask))
#define S_ISDIR(mode)     __S_ISTYPE((mode), S_IFDIR)
#endif

Surely a better place for such a thing is src/include/port/win32.h
... where indeed there already is a definition of S_ISDIR().
So I think this is dead code as well as poor style.  Any objection to
seeing what happens if we remove it?
        regards, tom lane


pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: Copyright waiver from Helios (fix for non-BSD copyright)
Next
From: David Fetter
Date:
Subject: Re: Randomly placed definition of S_ISDIR() in psql/copy.c