From 7083138fd401faa391c4f829a86b50fdb9c5c727 Mon Sep 17 00:00:00 2001 From: Lee Salzman Date: Wed, 26 Jun 2024 13:08:39 -0400 Subject: [PATCH] fix extern "C" usage --- include/enet/callbacks.h | 10 ++++++++++ include/enet/enet.h | 10 +++++----- include/enet/list.h | 9 +++++++++ 3 files changed, 24 insertions(+), 5 deletions(-) diff --git a/include/enet/callbacks.h b/include/enet/callbacks.h index 340a4a98..78a85d3c 100644 --- a/include/enet/callbacks.h +++ b/include/enet/callbacks.h @@ -14,14 +14,24 @@ typedef struct _ENetCallbacks void (ENET_CALLBACK * no_memory) (void); } ENetCallbacks; +#ifdef __cplusplus +extern "C" +{ +#endif + /** @defgroup callbacks ENet internal callbacks @{ @ingroup private */ + extern void * enet_malloc (size_t); extern void enet_free (void *); /** @} */ +#ifdef __cplusplus +} +#endif + #endif /* __ENET_CALLBACKS_H__ */ diff --git a/include/enet/enet.h b/include/enet/enet.h index c748eb54..dfa2c703 100644 --- a/include/enet/enet.h +++ b/include/enet/enet.h @@ -5,11 +5,6 @@ #ifndef __ENET_ENET_H__ #define __ENET_ENET_H__ -#ifdef __cplusplus -extern "C" -{ -#endif - #include #ifdef _WIN32 @@ -446,6 +441,11 @@ typedef struct _ENetEvent ENetPacket * packet; /**< packet associated with the event, if appropriate */ } ENetEvent; +#ifdef __cplusplus +extern "C" +{ +#endif + /** @defgroup global ENet global functions @{ */ diff --git a/include/enet/list.h b/include/enet/list.h index d7b26008..076e8860 100644 --- a/include/enet/list.h +++ b/include/enet/list.h @@ -20,6 +20,11 @@ typedef struct _ENetList ENetListNode sentinel; } ENetList; +#ifdef __cplusplus +extern "C" +{ +#endif + extern void enet_list_clear (ENetList *); extern ENetListIterator enet_list_insert (ENetListIterator, void *); @@ -28,6 +33,10 @@ extern ENetListIterator enet_list_move (ENetListIterator, void *, void *); extern size_t enet_list_size (ENetList *); +#ifdef __cplusplus +} +#endif + #define enet_list_begin(list) ((list) -> sentinel.next) #define enet_list_end(list) (& (list) -> sentinel)