Re: A micro-optimisation for walkdir() - Mailing list pgsql-hackers

From Tom Lane
Subject Re: A micro-optimisation for walkdir()
Date
Msg-id 968019.1599255574@sss.pgh.pa.us
Whole thread Raw
In response to Re: A micro-optimisation for walkdir()  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Responses Re: A micro-optimisation for walkdir()
List pgsql-hackers
Alvaro Herrera <alvherre@2ndquadrant.com> writes:
> On 2020-Sep-04, Juan José Santamaría Flecha wrote:
>> If will fail to detect that the patch makes the optimisation available for
>> WIN32:
>> 
>> +#if defined(DT_UNKNOWN) && defined(DT_REG) && defined(DT_DIR) &&
>> defined(DT_LNK)

> Oh, I see.  I suggest that it'd be better to change this line instead.

I think that it's standard to test for such symbols by seeing
if they're defined as macros ... not least because that's the *only*
way to test their existence in C.

Personally, what I'd do is lose the enum and just define the macros
with simple integer constant values.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Alvaro Herrera
Date:
Subject: Re: PATCH: Batch/pipelining support for libpq
Next
From: Tom Lane
Date:
Subject: Re: Questionable ping logic in LogicalRepApplyLoop