diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-05-07 10:44:56 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2024-05-07 11:25:24 +0200 |
commit | 3f5377d6810de412c8963414f66f472fc740cad9 (patch) | |
tree | 042266942978c672ae879f8964772ed524d29880 /libs/enet/callbacks.c | |
parent | afbfb8b5792fb1e8b8bf5777576680f1a4f0cd08 (diff) | |
download | mana-3f5377d6810de412c8963414f66f472fc740cad9.tar.gz mana-3f5377d6810de412c8963414f66f472fc740cad9.tar.bz2 mana-3f5377d6810de412c8963414f66f472fc740cad9.tar.xz mana-3f5377d6810de412c8963414f66f472fc740cad9.zip |
Replaced ENet with submodule
This also updates ENet from 1.3.2 to 1.3.18.
The previously supported WITH_BUNDLEDHEADERS option that affected which
ENet was being used has now been reversed and renamed to
USE_SYSTEM_ENET, which defaults to OFF for now.
Diffstat (limited to 'libs/enet/callbacks.c')
-rw-r--r-- | libs/enet/callbacks.c | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/libs/enet/callbacks.c b/libs/enet/callbacks.c deleted file mode 100644 index f9412825..00000000 --- a/libs/enet/callbacks.c +++ /dev/null @@ -1,47 +0,0 @@ -/** - @file callbacks.c - @brief ENet callback functions -*/ -#define ENET_BUILDING_LIB 1 -#include "enet/enet.h" - -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) - return -1; - - callbacks.malloc = inits -> malloc; - callbacks.free = inits -> free; - } - - if (inits -> no_memory != NULL) - callbacks.no_memory = inits -> no_memory; - - return enet_initialize (); -} - -void * -enet_malloc (size_t size) -{ - void * memory = callbacks.malloc (size); - - if (memory == NULL) - callbacks.no_memory (); - - return memory; -} - -void -enet_free (void * memory) -{ - callbacks.free (memory); -} - |