Re: qsort vs MSVC build - Mailing list pgsql-hackers

From Tom Lane
Subject Re: qsort vs MSVC build
Date
Msg-id 29952.1161281460@sss.pgh.pa.us
Whole thread Raw
In response to Re: qsort vs MSVC build  (Neil Conway <neilc@samurai.com>)
List pgsql-hackers
Neil Conway <neilc@samurai.com> writes:
> On Thu, 2006-10-19 at 13:56 -0400, Tom Lane wrote:
>> Is it worth renaming our qsort to pg_qsort to avoid this?  (I'd be
>> inclined to do that via a macro "#define qsort pg_qsort", not by running
>> around and changing all the code.)

> Why not change each call site? I don't think it would hurt to be clear
> about the fact that we're calling our own sorting function, not the
> platform's libc qsort().

I'm concerned about the prospect of someone forgetting to use pg_qsort,
and getting the likely-inferior platform one.

However, the only place where we probably care very much is tuplesort.c,
and that's using qsort_arg now anyway.  So plan C might be to drop
port/qsort.c altogether, and just be sure to use qsort_arg anyplace that
we care about not getting the platform one.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Neil Conway
Date:
Subject: Re: qsort vs MSVC build
Next
From: Steve Crawford
Date:
Subject: Re: CVS repository rsync