components/python/python26/patches/Python26-17-netpacket-packet-h.patch
changeset 4984 7145b15b7f0d
parent 4983 db2589571faa
child 4985 eed3576cafd0
equal deleted inserted replaced
4983:db2589571faa 4984:7145b15b7f0d
     1 diff --git Python-2.6.4/Modules/socketmodule.c Python-2.6.4/Modules/socketmodule.c
       
     2 --- Python-2.6.4/Modules/socketmodule.c
       
     3 +++ Python-2.6.4/Modules/socketmodule.c
       
     4 @@ -81,6 +81,14 @@
       
     5  
       
     6  */
       
     7  
       
     8 +#ifdef HAVE_NETPACKET_PACKET_H
       
     9 +#ifdef sun
       
    10 +#define USE_NETPACKET_PACKET_H 0
       
    11 +#else
       
    12 +#define USE_NETPACKET_PACKET_H 1
       
    13 +#endif
       
    14 +#endif
       
    15 +
       
    16  #ifdef __APPLE__
       
    17    /*
       
    18     * inet_aton is not available on OSX 10.3, yet we want to use a binary
       
    19 @@ -1096,7 +1104,7 @@
       
    20          }
       
    21  #endif
       
    22  
       
    23 -#ifdef HAVE_NETPACKET_PACKET_H
       
    24 +#if USE_NETPACKET_PACKET_H
       
    25      case AF_PACKET:
       
    26      {
       
    27          struct sockaddr_ll *a = (struct sockaddr_ll *)addr;
       
    28 @@ -1387,7 +1395,7 @@
       
    29      }
       
    30  #endif
       
    31  
       
    32 -#ifdef HAVE_NETPACKET_PACKET_H
       
    33 +#if USE_NETPACKET_PACKET_H
       
    34      case AF_PACKET:
       
    35      {
       
    36          struct sockaddr_ll* addr;
       
    37 @@ -1564,7 +1572,7 @@
       
    38      }
       
    39  #endif
       
    40  
       
    41 -#ifdef HAVE_NETPACKET_PACKET_H
       
    42 +#if USE_NETPACKET_PACKET_H
       
    43      case AF_PACKET:
       
    44      {
       
    45          *len_ret = sizeof (struct sockaddr_ll);
       
    46 @@ -4599,7 +4607,7 @@
       
    47      PyModule_AddStringConstant(m, "BDADDR_LOCAL", "00:00:00:FF:FF:FF");
       
    48  #endif
       
    49  
       
    50 -#ifdef HAVE_NETPACKET_PACKET_H
       
    51 +#if USE_NETPACKET_PACKET_H
       
    52      PyModule_AddIntConstant(m, "AF_PACKET", AF_PACKET);
       
    53      PyModule_AddIntConstant(m, "PF_PACKET", PF_PACKET);
       
    54      PyModule_AddIntConstant(m, "PACKET_HOST", PACKET_HOST);