From 572636062e61ad66cc2b4d232394d9de0645baf2 Mon Sep 17 00:00:00 2001 From: eihrul Date: Wed, 9 Jun 2010 21:16:23 +0000 Subject: 1.3.0 import --- callbacks.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'callbacks.c') diff --git a/callbacks.c b/callbacks.c index a062694..f941282 100644 --- a/callbacks.c +++ b/callbacks.c @@ -5,11 +5,14 @@ #define ENET_BUILDING_LIB 1 #include "enet/enet.h" -static ENetCallbacks callbacks = { malloc, free, rand, abort }; +static ENetCallbacks callbacks = { malloc, free, abort }; int enet_initialize_with_callbacks (ENetVersion version, const ENetCallbacks * inits) { + if (version < ENET_VERSION_CREATE (1, 3, 0)) + return -1; + if (inits -> malloc != NULL || inits -> free != NULL) { if (inits -> malloc == NULL || inits -> free == NULL) @@ -19,14 +22,8 @@ enet_initialize_with_callbacks (ENetVersion version, const ENetCallbacks * inits callbacks.free = inits -> free; } - if (inits -> rand != NULL) - callbacks.rand = inits -> rand; - - if (version >= ENET_VERSION_CREATE (1, 2, 2)) - { - if (inits -> no_memory != NULL) - callbacks.no_memory = inits -> no_memory; - } + if (inits -> no_memory != NULL) + callbacks.no_memory = inits -> no_memory; return enet_initialize (); } @@ -48,9 +45,3 @@ enet_free (void * memory) callbacks.free (memory); } -int -enet_rand (void) -{ - return callbacks.rand (); -} - -- cgit v1.2.3