Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

Ignore:
Timestamp:
Sep 9, 2010, 5:02:16 PM (14 years ago)
Author:
rgrieder
Message:

Compile ENet as C library.

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

Legend:

Unmodified
Added
Removed
  • code/branches/ipv6/src/external/enet/CMakeLists.txt

    r7390 r7391  
    2929    include/enet/win32.h
    3030
    31 COMPILATION_BEGIN ENetCompilation.cpp
     31COMPILATION_BEGIN ENetCompilation.c
    3232    callbacks.c
    3333    compress.c
  • code/branches/ipv6/src/external/enet/host.c

    r7389 r7391  
    5353    ENetHost * host;
    5454    ENetPeer * currentPeer;
     55    int family;
    5556
    5657    if (peerCount > ENET_PROTOCOL_MAXIMUM_PEER_ID)
     
    7071    memset (host -> peers, 0, peerCount * sizeof (ENetPeer));
    7172
    72     int family = (address == NULL || !memcmp (& address -> host, & ENET_HOST_ANY, sizeof (ENetHostAddress))) ?
     73    family = (address == NULL || !memcmp (& address -> host, & ENET_HOST_ANY, sizeof (ENetHostAddress))) ?
    7374        ENET_IPV4 | ENET_IPV6 :
    7475        enet_get_address_family (address);
  • code/branches/ipv6/src/external/enet/include/enet/enet.h

    r7390 r7391  
    5959} ENetHostAddress;
    6060
    61 extern const ENetHostAddress ENET_HOST_ANY;          /**< specifies the default server host */
    62 extern const ENetHostAddress ENET_IPV4MAPPED_PREFIX; /**< specifies the IPv4-mapped IPv6 prefix */
    63 extern const ENetHostAddress ENET_HOST_BROADCAST;    /**< specifies a IPv4 subnet-wide broadcast */
     61extern ENET_API const ENetHostAddress ENET_HOST_ANY;          /**< specifies the default server host */
     62extern ENET_API const ENetHostAddress ENET_IPV4MAPPED_PREFIX; /**< specifies the IPv4-mapped IPv6 prefix */
     63extern ENET_API const ENetHostAddress ENET_HOST_BROADCAST;    /**< specifies a IPv4 subnet-wide broadcast */
    6464#define ENET_IPV4MAPPED_PREFIX_LEN 12                /**< specifies the length of the IPv4-mapped IPv6 prefix */
    6565#define ENET_PORT_ANY 0                              /**< specifies that a port should be automatically chosen */
  • code/branches/ipv6/src/external/enet/protocol.c

    r7389 r7391  
    13981398         ++ currentPeer)
    13991399    {
     1400        ENetAddressFamily family;
     1401        ENetSocket socket;
     1402
    14001403        if (currentPeer -> state == ENET_PEER_STATE_DISCONNECTED ||
    14011404            currentPeer -> state == ENET_PEER_STATE_ZOMBIE)
     
    15221525        currentPeer -> lastSendTime = host -> serviceTime;
    15231526
    1524         ENetAddressFamily family = enet_get_address_family (& currentPeer -> address);
    1525         ENetSocket socket = family == ENET_IPV4 ? host -> socket4 : host -> socket6;
     1527        family = enet_get_address_family (& currentPeer -> address);
     1528        socket = family == ENET_IPV4 ? host -> socket4 : host -> socket6;
    15261529        if (socket == ENET_SOCKET_NULL)
    15271530          return -1;
  • code/branches/ipv6/src/external/enet/win32.c

    r7390 r7391  
    181181    else
    182182    {
    183         ENetAddress address_ = { ENET_HOST_ANY, 0, 0 };
     183        ENetAddress address_;
     184        address_.host = ENET_HOST_ANY;
     185        address_.scopeID = 0;
     186        address_.port = 0;
    184187        enet_address_set_sin((SOCKADDR *) & sin, & address_, family);
    185188    }
     
    366369    struct timeval timeVal;
    367370    int selectCount;
     371    ENetSocket maxSocket;
    368372
    369373    timeVal.tv_sec = timeout / 1000;
     
    389393    }
    390394
    391     ENetSocket maxSocket = 0;
     395    maxSocket = 0;
    392396    if (socket4 != ENET_SOCKET_NULL)
    393397        maxSocket = socket4;
Note: See TracChangeset for help on using the changeset viewer.