diff options
author | eihrul <eihrul> | 2010-06-09 21:16:23 +0000 |
---|---|---|
committer | eihrul <eihrul> | 2010-06-09 21:16:23 +0000 |
commit | 572636062e61ad66cc2b4d232394d9de0645baf2 (patch) | |
tree | 1307f92de016aaf9fc32179eff193a820d49c2b6 /callbacks.c | |
parent | 2d985dba913f815302b8fb86c9ff0956f3c2f1a3 (diff) | |
download | enet-572636062e61ad66cc2b4d232394d9de0645baf2.tar.gz enet-572636062e61ad66cc2b4d232394d9de0645baf2.zip |
1.3.0 import
Diffstat (limited to 'callbacks.c')
-rw-r--r-- | callbacks.c | 21 |
1 files changed, 6 insertions, 15 deletions
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 (); -} - |