Re: qsort vs MSVC build

From: "Magnus Hagander" <mha(at)sollentuna(dot)net>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: qsort vs MSVC build
Date: 2006-10-19 17:58:37
Message-ID: 6BCB9D8A16AC4241919521715F4D8BCEA0FC93@algol.sollentuna.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> > MSVCRTD.lib(MSVCR80D.dll) : error LNK2005: _qsort already
> defined in
> > qsort.obj
>
> Hmm. I've been seeing related complaints on Darwin, but they
> were just warnings (about our qsort conflicting with the one in libc).

Yeah, seems it works in Mingw, but for some reason it's fatal in MSVC.

> 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.)

Yeah, I think it is ;-) Just make sure it happens before we pull in
stdlib.h, so we don't rename tha tone as well...

//Magnus

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Martijn van Oosterhout 2006-10-19 18:01:14 Re: qsort vs MSVC build
Previous Message Tom Lane 2006-10-19 17:57:23 Re: Adminpack build fix