Index: configure =================================================================== --- configure (révision 82776) +++ configure (copie de travail) @@ -1,5 +1,5 @@ #! /bin/sh -# From configure.in Revision: 82090 . +# From configure.in Revision: 82746 . # Guess values for system-dependent variables and create Makefiles. # Generated by GNU Autoconf 2.65 for python 3.2. # @@ -1929,11 +1929,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default - enum { N = $2 / 2 - 1 }; int main () { -static int test_array [1 - 2 * !(0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; +static int test_array [1 - 2 * !(enum { N = $2 / 2 - 1 }; + 0 < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1))]; test_array [0] = 0 ; @@ -1944,11 +1944,11 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_ext /* end confdefs.h. */ $ac_includes_default - enum { N = $2 / 2 - 1 }; int main () { -static int test_array [1 - 2 * !(($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) +static int test_array [1 - 2 * !(enum { N = $2 / 2 - 1 }; + ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 1) < ($ac_type) ((((($ac_type) 1 << N) << N) - 1) * 2 + 2))]; test_array [0] = 0 @@ -6269,6 +6269,25 @@ done +# On Linux, irda.h requires sys/socket.h +for ac_header in linux/irda.h +do : + ac_fn_c_check_header_compile "$LINENO" "linux/irda.h" "ac_cv_header_linux_irda_h" " +#ifdef HAVE_SYS_SOCKET_H +#include +#endif + +" +if test "x$ac_cv_header_linux_irda_h" = x""yes; then : + cat >>confdefs.h <<_ACEOF +#define HAVE_LINUX_IRDA_H 1 +_ACEOF + +fi + +done + + # checks for typedefs was_it_defined=no { $as_echo "$as_me:${as_lineno-$LINENO}: checking for clock_t in time.h" >&5 @@ -14086,8 +14105,8 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 # Files that config.status was made for. -config_files="$ac_config_files" -config_headers="$ac_config_headers" +config_files="`echo $ac_config_files`" +config_headers="`echo $ac_config_headers`" _ACEOF Index: configure.in =================================================================== --- configure.in (révision 82776) +++ configure.in (copie de travail) @@ -1329,6 +1329,13 @@ #endif ]) +# On Linux, irda.h requires sys/socket.h +AC_CHECK_HEADERS(linux/irda.h,,,[ +#ifdef HAVE_SYS_SOCKET_H +#include +#endif +]) + # checks for typedefs was_it_defined=no AC_MSG_CHECKING(for clock_t in time.h) Index: Modules/socketmodule.c =================================================================== --- Modules/socketmodule.c (révision 82776) +++ Modules/socketmodule.c (copie de travail) @@ -1469,6 +1469,33 @@ } #endif +#ifdef HAVE_IRDA_H + case AF_IRDA: + { + struct sockaddr_irda* addr; + int daddr = 0; + char *service = NULL; + addr = (struct sockaddr_irda *) addr_ret; + if (!PyArg_ParseTuple(args, "is", &daddr, &service)) + return 0; +#ifdef HAVE_LINUX_IRDA_H + addr->sir_family = AF_IRDA; + strncpy(addr->sir_name, service, + sizeof(addr->sir_name) / sizeof(char)); + addr->sir_addr = daddr; + addr->sir_lsap_sel = LSAP_ANY; +#else /* Windows */ + addr->irdaAddressFamily = AF_IRDA; + strncpy(addr->irdaServiceName, service, + sizeof(addr->irdaServiceName) / sizeof(char)); + memcpy(addr->irdaDeviceID, &daddr, 4); +#endif + + *len_ret = sizeof *addr; + return 1; + } +#endif + /* More cases here... */ default: @@ -1562,6 +1589,14 @@ } #endif +#ifdef HAVE_IRDA_H + case AF_IRDA: + { + *len_ret = sizeof (struct sockaddr_irda); + return 1; + } +#endif + /* More cases here... */ default: @@ -4484,6 +4519,13 @@ PyModule_AddIntConstant(m, "TIPC_TOP_SRV", TIPC_TOP_SRV); #endif +#ifdef HAVE_IRDA_H + PyModule_AddIntConstant(m, "SOL_IRLMP", SOL_IRLMP); + PyModule_AddIntConstant(m, "IRLMP_ENUMDEVICES", IRLMP_ENUMDEVICES); + PyModule_AddIntConstant(m, "IRLMP_IAS_SET", IRLMP_IAS_SET); + PyModule_AddIntConstant(m, "IRLMP_IAS_QUERY", IRLMP_IAS_QUERY); +#endif + /* Socket types */ PyModule_AddIntConstant(m, "SOCK_STREAM", SOCK_STREAM); PyModule_AddIntConstant(m, "SOCK_DGRAM", SOCK_DGRAM); Index: Modules/socketmodule.h =================================================================== --- Modules/socketmodule.h (révision 82776) +++ Modules/socketmodule.h (copie de travail) @@ -69,6 +69,17 @@ # include #endif +#if (defined(MS_WINDOWS) || defined(HAVE_LINUX_IRDA_H)) +#define HAVE_IRDA_H +#ifdef HAVE_LINUX_IRDA_H +#include +#include +#else +#include +#define sockaddr_irda _SOCKADDR_IRDA +#endif +#endif + #ifndef Py__SOCKET_H #define Py__SOCKET_H #ifdef __cplusplus @@ -115,6 +126,9 @@ #ifdef HAVE_NETPACKET_PACKET_H struct sockaddr_ll ll; #endif +#ifdef HAVE_IRDA_H + struct sockaddr_irda ir; +#endif } sock_addr_t; /* The object holding a socket. It holds some extra information, Index: pyconfig.h.in =================================================================== --- pyconfig.h.in (révision 82776) +++ pyconfig.h.in (copie de travail) @@ -419,6 +419,9 @@ /* Define if you have the 'link' function. */ #undef HAVE_LINK +/* Define to 1 if you have the header file. */ +#undef HAVE_LINUX_IRDA_H + /* Define to 1 if you have the header file. */ #undef HAVE_LINUX_NETLINK_H