[Python-checkins] CVS: python/dist/src/Modules _localemodule.c,2.21,2.22 addrinfo.h,1.2,1.3 getnameinfo.c,1.3,1.4 socketmodule.c,1.164,1.165

Martin v. L?wis loewis@users.sourceforge.net
2001年8月15日 10:14:35 -0700


Update of /cvsroot/python/python/dist/src/Modules
In directory usw-pr-cvs1:/tmp/cvs-serv25237/Modules
Modified Files:
	_localemodule.c addrinfo.h getnameinfo.c socketmodule.c 
Log Message:
Fix portability problems with glibc 2.0, as reported in #449157.
Index: _localemodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/_localemodule.c,v
retrieving revision 2.21
retrieving revision 2.22
diff -C2 -d -r2.21 -r2.22
*** _localemodule.c	2001年08月10日 19:41:45	2.21
--- _localemodule.c	2001年08月15日 17:14:33	2.22
***************
*** 528,531 ****
--- 528,533 ----
 ADDINT(ABMON_12);
 
+ #ifdef RADIXCHAR
+ /* The following are not available with glibc 2.0 */
 ADDINT(RADIXCHAR);
 ADDINT(THOUSEP);
***************
*** 538,541 ****
--- 540,544 ----
 */
 ADDINT(CRNCYSTR);
+ #endif
 
 ADDINT(D_T_FMT);
Index: addrinfo.h
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/addrinfo.h,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -d -r1.2 -r1.3
*** addrinfo.h	2001年07月19日 17:37:46	1.2
--- addrinfo.h	2001年08月15日 17:14:33	1.3
***************
*** 68,71 ****
--- 68,75 ----
 #endif
 
+ #endif /* HAVE_GETADDRINFO */
+ 
+ #ifndef HAVE_GETNAMEINFO
+ 
 /*
 * Constants for getnameinfo()
***************
*** 87,90 ****
--- 91,96 ----
 #endif
 
+ #endif /* HAVE_GETNAMEINFO */
+ 
 #ifndef HAVE_ADDRINFO
 struct addrinfo {
***************
*** 137,140 ****
 #ifdef __cplusplus
 }
- #endif
 #endif
--- 143,145 ----
Index: getnameinfo.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/getnameinfo.c,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** getnameinfo.c	2001年07月21日 09:42:15	1.3
--- getnameinfo.c	2001年08月15日 17:14:33	1.4
***************
*** 82,85 ****
--- 82,89 ----
 #define ENI_SALEN	6
 
+ /* forward declaration to make gcc happy */
+ int getnameinfo Py_PROTO((const struct sockaddr *, size_t, char *, size_t,
+ 			 char *, size_t, int));
+ 
 int
 getnameinfo(sa, salen, host, hostlen, serv, servlen, flags)
Index: socketmodule.c
===================================================================
RCS file: /cvsroot/python/python/dist/src/Modules/socketmodule.c,v
retrieving revision 1.164
retrieving revision 1.165
diff -C2 -d -r1.164 -r1.165
*** socketmodule.c	2001年08月12日 09:28:40	1.164
--- socketmodule.c	2001年08月15日 17:14:33	1.165
***************
*** 448,452 ****
--- 448,456 ----
 		return PySocket_Err();
 
+ #ifdef HAVE_GAI_STRERROR
 	v = Py_BuildValue("(is)", error, gai_strerror(error));
+ #else
+ 	v = Py_BuildValue("(is)", error, "getaddrinfo failed");
+ #endif
 	if (v != NULL) {
 		PyErr_SetObject(PyGAI_Error, v);

AltStyle によって変換されたページ (->オリジナル) /