[HACKERS] qsort vs MSVC build

2006-10-19 Thread Magnus Hagander
I just tried a rebuild of the MSVC stuff, and got the following error. Any ideas on the best way to fix that? (as you notice, I haven't pulled the very latest cvs so I haven't for the min() fix that's put in now. Just let me know if the rest is also fixed ;-)) //Magnus Build started: Project:

Re: [HACKERS] qsort vs MSVC build

2006-10-19 Thread Tom Lane
Magnus Hagander [EMAIL PROTECTED] writes: I just tried a rebuild of the MSVC stuff, and got the following error. Any ideas on the best way to fix that? 1.\src\port\qsort.c(53) : warning C4005: 'min' : macro redefinition C:\Program Files\Microsoft Visual Studio This is fixed already

Re: [HACKERS] qsort vs MSVC build

2006-10-19 Thread Magnus Hagander
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.

Re: [HACKERS] qsort vs MSVC build

2006-10-19 Thread Martijn van Oosterhout
On Thu, Oct 19, 2006 at 01:56:24PM -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.) Redefining a function that is defined in POSIX and present on

Re: [HACKERS] qsort vs MSVC build

2006-10-19 Thread Tom Lane
Magnus Hagander [EMAIL PROTECTED] writes: 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

Re: [HACKERS] qsort vs MSVC build

2006-10-19 Thread Magnus Hagander
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

Re: [HACKERS] qsort vs MSVC build

2006-10-19 Thread Neil Conway
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

Re: [HACKERS] qsort vs MSVC build

2006-10-19 Thread Tom Lane
Neil Conway [EMAIL PROTECTED] 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?