|
|
@@ -833,13 +833,13 @@ extern "C" {
|
|
|
#include "mingw/inet_pton.c"
|
|
|
#endif
|
|
|
|
|
|
- /*
|
|
|
- =======================================================================
|
|
|
+/*
|
|
|
+=======================================================================
|
|
|
|
|
|
- Atomics
|
|
|
+ Atomics
|
|
|
|
|
|
- =======================================================================
|
|
|
- */
|
|
|
+=======================================================================
|
|
|
+*/
|
|
|
|
|
|
#ifdef _MSC_VER
|
|
|
#define ENET_AT_CASSERT_PRED(predicate) sizeof(char[2 * !!(predicate) - 1])
|
|
|
@@ -1025,13 +1025,13 @@ extern "C" {
|
|
|
#undef AT_HAVE_ATOMICS
|
|
|
#endif
|
|
|
|
|
|
- /*
|
|
|
- =======================================================================
|
|
|
+/*
|
|
|
+=======================================================================
|
|
|
|
|
|
- Callbacks
|
|
|
+ Callbacks
|
|
|
|
|
|
- =======================================================================
|
|
|
- */
|
|
|
+=======================================================================
|
|
|
+*/
|
|
|
|
|
|
static ENetCallbacks callbacks = {
|
|
|
malloc,
|
|
|
@@ -1070,13 +1070,13 @@ extern "C" {
|
|
|
callbacks.free(memory);
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- =======================================================================
|
|
|
+/*
|
|
|
+=======================================================================
|
|
|
|
|
|
- List
|
|
|
+ List
|
|
|
|
|
|
- =======================================================================
|
|
|
- */
|
|
|
+=======================================================================
|
|
|
+*/
|
|
|
|
|
|
void enet_list_clear(ENetList* list) {
|
|
|
list->sentinel.next = &list->sentinel;
|
|
|
@@ -1124,13 +1124,13 @@ extern "C" {
|
|
|
return size;
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- =======================================================================
|
|
|
+/*
|
|
|
+=======================================================================
|
|
|
|
|
|
- Utilities
|
|
|
+ Utilities
|
|
|
|
|
|
- =======================================================================
|
|
|
- */
|
|
|
+=======================================================================
|
|
|
+*/
|
|
|
|
|
|
ENetVersion enet_linked_version(void) {
|
|
|
return ENET_VERSION;
|
|
|
@@ -1171,13 +1171,13 @@ extern "C" {
|
|
|
return (s - source - 1);
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- =======================================================================
|
|
|
+/*
|
|
|
+=======================================================================
|
|
|
|
|
|
- Time
|
|
|
+ Time
|
|
|
|
|
|
- =======================================================================
|
|
|
- */
|
|
|
+=======================================================================
|
|
|
+*/
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
static LARGE_INTEGER gettime_offset(void) {
|
|
|
@@ -1290,13 +1290,13 @@ extern "C" {
|
|
|
return (enet_uint32)(result_in_ns / ns_in_ms);
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- =======================================================================
|
|
|
+/*
|
|
|
+=======================================================================
|
|
|
|
|
|
- Checksum
|
|
|
+ Checksum
|
|
|
|
|
|
- =======================================================================
|
|
|
- */
|
|
|
+=======================================================================
|
|
|
+*/
|
|
|
|
|
|
static int initializedCRC32 = 0;
|
|
|
static enet_uint32 crcTable[256];
|
|
|
@@ -1354,13 +1354,13 @@ extern "C" {
|
|
|
return ENET_HOST_TO_NET_32(~crc);
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- =======================================================================
|
|
|
+/*
|
|
|
+=======================================================================
|
|
|
|
|
|
- Packet
|
|
|
+ Packet
|
|
|
|
|
|
- =======================================================================
|
|
|
- */
|
|
|
+=======================================================================
|
|
|
+*/
|
|
|
|
|
|
ENetPacket* enet_packet_create(const void* data, size_t dataLength, enet_uint32 flags) {
|
|
|
ENetPacket* packet;
|
|
|
@@ -1432,13 +1432,13 @@ extern "C" {
|
|
|
enet_free(packet);
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- =======================================================================
|
|
|
+/*
|
|
|
+=======================================================================
|
|
|
|
|
|
- Protocol
|
|
|
+ Protocol
|
|
|
|
|
|
- =======================================================================
|
|
|
- */
|
|
|
+=======================================================================
|
|
|
+*/
|
|
|
|
|
|
static size_t commandSizes[ENET_PROTOCOL_COMMAND_COUNT] = {
|
|
|
0,
|
|
|
@@ -3113,13 +3113,13 @@ extern "C" {
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- =======================================================================
|
|
|
+/*
|
|
|
+=======================================================================
|
|
|
|
|
|
- Peer
|
|
|
+ Peer
|
|
|
|
|
|
- =======================================================================
|
|
|
- */
|
|
|
+=======================================================================
|
|
|
+*/
|
|
|
|
|
|
void enet_peer_throttle_configure(ENetPeer* peer, enet_uint32 interval, enet_uint32 acceleration, enet_uint32 deceleration, enet_uint32 threshold) {
|
|
|
ENetProtocol command;
|
|
|
@@ -3881,13 +3881,13 @@ extern "C" {
|
|
|
return NULL;
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- =======================================================================
|
|
|
+/*
|
|
|
+=======================================================================
|
|
|
|
|
|
- Host
|
|
|
+ Host
|
|
|
|
|
|
- =======================================================================
|
|
|
- */
|
|
|
+=======================================================================
|
|
|
+*/
|
|
|
|
|
|
ENetHost* enet_host_create(const ENetAddress* address, size_t peerCount, size_t channelLimit, enet_uint32 incomingBandwidth, enet_uint32 outgoingBandwidth, int bufferSize) {
|
|
|
ENetHost* host;
|
|
|
@@ -4321,13 +4321,13 @@ extern "C" {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- =======================================================================
|
|
|
+/*
|
|
|
+=======================================================================
|
|
|
|
|
|
- Address
|
|
|
+ Address
|
|
|
|
|
|
- =======================================================================
|
|
|
- */
|
|
|
+=======================================================================
|
|
|
+*/
|
|
|
|
|
|
int enet_address_set_host_ip(ENetAddress* address, const char* ip) {
|
|
|
int type = AF_INET6;
|
|
|
@@ -4421,13 +4421,13 @@ extern "C" {
|
|
|
return enet_address_get_host_ip(address, name, nameLength);
|
|
|
}
|
|
|
|
|
|
- /*
|
|
|
- =======================================================================
|
|
|
+/*
|
|
|
+=======================================================================
|
|
|
|
|
|
- Platform-specific (Unix)
|
|
|
+ Platform-specific (Unix)
|
|
|
|
|
|
- =======================================================================
|
|
|
- */
|
|
|
+=======================================================================
|
|
|
+*/
|
|
|
|
|
|
#ifndef _WIN32
|
|
|
int enet_initialize(void) {
|
|
|
@@ -4732,13 +4732,13 @@ extern "C" {
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
- /*
|
|
|
- =======================================================================
|
|
|
+/*
|
|
|
+=======================================================================
|
|
|
|
|
|
- Platform-specific (Windows)
|
|
|
+ Platform-specific (Windows)
|
|
|
|
|
|
- =======================================================================
|
|
|
- */
|
|
|
+=======================================================================
|
|
|
+*/
|
|
|
|
|
|
#ifdef _WIN32
|
|
|
int enet_initialize(void) {
|
|
|
@@ -5017,13 +5017,13 @@ extern "C" {
|
|
|
}
|
|
|
#endif
|
|
|
|
|
|
- /*
|
|
|
- =======================================================================
|
|
|
+/*
|
|
|
+=======================================================================
|
|
|
|
|
|
- Extended functionality
|
|
|
+ Extended functionality
|
|
|
|
|
|
- =======================================================================
|
|
|
- */
|
|
|
+=======================================================================
|
|
|
+*/
|
|
|
|
|
|
void* enet_packet_get_data(const ENetPacket* packet) {
|
|
|
return (void*)packet->data;
|