Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Changeset 7397


Ignore:
Timestamp:
Sep 10, 2010, 2:30:21 PM (14 years ago)
Author:
adrfried
Message:

add _INIT macros for the address variables

Location:
code/branches/ipv6/src/external/enet
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • code/branches/ipv6/src/external/enet/host.c

    r7396 r7397  
    1515        return ENET_SOCKET_NULL;
    1616
     17    /* This is not a conditional bind anymore,
     18     * because WSARecvFrom returned WSAEINVAL on the IPv6 socket.
     19     * TODO: Check for it's consequences. */
    1720    if (enet_socket_bind (socket, address, family) < 0)
    1821    {
  • code/branches/ipv6/src/external/enet/include/enet/enet.h

    r7392 r7397  
    5959} ENetHostAddress;
    6060
    61 ENET_API const ENetHostAddress ENET_HOST_ANY;          /**< specifies the default server host */
    62 ENET_API const ENetHostAddress ENET_IPV4MAPPED_PREFIX; /**< specifies the IPv4-mapped IPv6 prefix */
    63 ENET_API const ENetHostAddress ENET_HOST_BROADCAST;    /**< specifies a IPv4 subnet-wide broadcast */
    64 #define ENET_IPV4MAPPED_PREFIX_LEN 12                  /**< specifies the length of the IPv4-mapped IPv6 prefix */
    65 #define ENET_PORT_ANY 0                                /**< specifies that a port should be automatically chosen */
     61#define ENET_HOST_ANY_INIT { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } }                         /**< specifies the default server host (macro for variable initialization) */
     62ENET_API const ENetHostAddress ENET_HOST_ANY;                                              /**< specifies the default server host (global constant variable) */
     63#define ENET_IPV4MAPPED_PREFIX_INIT { { 0,0,0,0,0,0,0,0,0,0,0xff,0xff,0,0,0,0 } }          /**< specifies the IPv4-mapped IPv6 prefix (macro for variable initialization) */
     64ENET_API const ENetHostAddress ENET_IPV4MAPPED_PREFIX;                                     /**< specifies the IPv4-mapped IPv6 prefix (global constant variable) */
     65#define ENET_HOST_BROADCAST_INIT { { 0,0,0,0,0,0,0,0,0,0,0xff,0xff,0xff,0xff,0xff,0xff } } /**< specifies a IPv4 subnet-wide broadcast (macro for variable initialization) */
     66ENET_API const ENetHostAddress ENET_HOST_BROADCAST;                                        /**< specifies a IPv4 subnet-wide broadcast (global constant variable) */
     67enum {
     68    ENET_IPV4MAPPED_PREFIX_LEN = 12,                                                       /**< specifies the length of the IPv4-mapped IPv6 prefix */
     69    ENET_PORT_ANY              = 0                                                         /**< specifies that a port should be automatically chosen */
     70};
    6671
    6772/**
  • code/branches/ipv6/src/external/enet/protocol.c

    r7391 r7397  
    1010#include "enet/enet.h"
    1111
    12 const ENetHostAddress ENET_HOST_ANY = { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } };
    13 const ENetHostAddress ENET_IPV4MAPPED_PREFIX = { { 0,0,0,0,0,0,0,0,0,0, 0xff, 0xff, 0,0,0,0 } };
    14 const ENetHostAddress ENET_HOST_BROADCAST = { { 0,0,0,0,0,0,0,0,0,0, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff } };
     12const ENetHostAddress ENET_HOST_ANY = ENET_HOST_ANY_INIT;
     13const ENetHostAddress ENET_IPV4MAPPED_PREFIX = ENET_IPV4MAPPED_PREFIX_INIT;
     14const ENetHostAddress ENET_HOST_BROADCAST = ENET_HOST_BROADCAST_INIT;
    1515
    1616static size_t commandSizes [ENET_PROTOCOL_COMMAND_COUNT] =
     
    3333enet_address_map4 (enet_uint32 address)
    3434{
    35     ENetHostAddress addr = ENET_IPV4MAPPED_PREFIX;
     35    ENetHostAddress addr = ENET_IPV4MAPPED_PREFIX_INIT;
    3636    ((enet_uint32 *)addr.addr)[3] = address;
    3737    return addr;
  • code/branches/ipv6/src/external/enet/unix.c

    r7394 r7397  
    200200    else
    201201    {
    202         ENetAddress address_;
    203         address_.host = ENET_HOST_ANY;
    204         address_.scopeID = 0;
    205         address_.port = 0;
     202        ENetAddress address_ = { ENET_HOST_ANY_INIT, 0, 0 };
    206203        enet_address_set_sin((struct sockaddr *) & sin, & address_, family);
    207204    }
  • code/branches/ipv6/src/external/enet/win32.c

    r7394 r7397  
    181181    else
    182182    {
    183         ENetAddress address_;
    184         address_.host = ENET_HOST_ANY;
    185         address_.scopeID = 0;
    186         address_.port = 0;
     183        ENetAddress address_ = { ENET_HOST_ANY_INIT, 0, 0 };
    187184        enet_address_set_sin((SOCKADDR *) & sin, & address_, family);
    188185    }
Note: See TracChangeset for help on using the changeset viewer.