warning: "min" redefined of qsort.

Started by Hiroshi Saitoover 19 years ago3 messages
#1Hiroshi Saito
z-saito@guitar.ocn.ne.jp
1 attachment(s)

Hi.

I have warning with MinGW....

qsort.c:53:1: warning: "min" redefined
In file included from C:/MinGW/include/windows.h:48,
from ../../src/include/pg_config_os.h:12,
from ../../src/include/c.h:88,
from qsort.c:46:
C:/MinGW/include/windef.h:143:1: warning: this is the location of the previous definition
qsort_arg.c:53:1: warning: "min" redefined
In file included from C:/MinGW/include/windows.h:48,
from ../../src/include/pg_config_os.h:12,
from ../../src/include/c.h:88,
from qsort_arg.c:46:
C:/MinGW/include/windef.h:143:1: warning: this is the location of the previous definition
qsort.c:53:1: warning: "min" redefined
In file included from C:/MinGW/include/windows.h:48,
from ../../src/include/pg_config_os.h:12,
from ../../src/include/c.h:88,
from qsort.c:46:
C:/MinGW/include/windef.h:143:1: warning: this is the location of the previous definition
qsort_arg.c:53:1: warning: "min" redefined
In file included from C:/MinGW/include/windows.h:48,
from ../../src/include/pg_config_os.h:12,
from ../../src/include/c.h:88,
from qsort_arg.c:46:

Therefore, please consider this.

Regards,
Hiroshi Saito

Attachments:

qsort_win32_patchapplication/octet-stream; name=qsort_win32_patchDownload
--- src/port/qsort.c.orig	Thu Oct 12 09:14:34 2006
+++ src/port/qsort.c	Thu Oct 12 09:29:15 2006
@@ -50,6 +50,7 @@
 	 int (*) (const void *, const void *));
 static void swapfunc(char *, char *, size_t, int);
 
+#undef min
 #define min(a, b)	((a) < (b) ? (a) : (b))
 
 /*
--- src/port/qsort_arg.c.orig	Thu Oct 12 09:14:40 2006
+++ src/port/qsort_arg.c	Thu Oct 12 09:29:32 2006
@@ -50,6 +50,7 @@
 	 qsort_arg_comparator cmp, void *arg);
 static void swapfunc(char *, char *, size_t, int);
 
+#undef min
 #define min(a, b)	((a) < (b) ? (a) : (b))
 
 /*
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Hiroshi Saito (#1)
Re: warning: "min" redefined of qsort.

"Hiroshi Saito" <z-saito@guitar.ocn.ne.jp> writes:

I have warning with MinGW....
qsort.c:53:1: warning: "min" redefined

I've fixed this by using Min() from c.h instead.

regards, tom lane

#3Hiroshi Saito
z-saito@guitar.ocn.ne.jp
In reply to: Hiroshi Saito (#1)
Re: warning: "min" redefined of qsort.

Hi Tom-san.

From: "Tom Lane"

"Hiroshi Saito" <z-saito@guitar.ocn.ne.jp> writes:

I have warning with MinGW....
qsort.c:53:1: warning: "min" redefined

I've fixed this by using Min() from c.h instead.

Ahh, I was consideration shortage.
Thanks!!

Regards,
Hiroshi Saito