fix extern "C" usage
Some checks failed
CMake / CMake ${{ matrix.os }} ${{ matrix.build_type }} (Debug, macos-latest) (push) Has been cancelled
CMake / CMake ${{ matrix.os }} ${{ matrix.build_type }} (Debug, ubuntu-latest) (push) Has been cancelled
CMake / CMake ${{ matrix.os }} ${{ matrix.build_type }} (Debug, windows-latest) (push) Has been cancelled
CMake / CMake ${{ matrix.os }} ${{ matrix.build_type }} (Release, macos-latest) (push) Has been cancelled
CMake / CMake ${{ matrix.os }} ${{ matrix.build_type }} (Release, ubuntu-latest) (push) Has been cancelled
CMake / CMake ${{ matrix.os }} ${{ matrix.build_type }} (Release, windows-latest) (push) Has been cancelled

This commit is contained in:
Lee Salzman 2024-06-26 13:08:39 -04:00
parent 29260f79cf
commit 7083138fd4
3 changed files with 24 additions and 5 deletions

View file

@ -14,14 +14,24 @@ typedef struct _ENetCallbacks
void (ENET_CALLBACK * no_memory) (void); void (ENET_CALLBACK * no_memory) (void);
} ENetCallbacks; } ENetCallbacks;
#ifdef __cplusplus
extern "C"
{
#endif
/** @defgroup callbacks ENet internal callbacks /** @defgroup callbacks ENet internal callbacks
@{ @{
@ingroup private @ingroup private
*/ */
extern void * enet_malloc (size_t); extern void * enet_malloc (size_t);
extern void enet_free (void *); extern void enet_free (void *);
/** @} */ /** @} */
#ifdef __cplusplus
}
#endif
#endif /* __ENET_CALLBACKS_H__ */ #endif /* __ENET_CALLBACKS_H__ */

View file

@ -5,11 +5,6 @@
#ifndef __ENET_ENET_H__ #ifndef __ENET_ENET_H__
#define __ENET_ENET_H__ #define __ENET_ENET_H__
#ifdef __cplusplus
extern "C"
{
#endif
#include <stdlib.h> #include <stdlib.h>
#ifdef _WIN32 #ifdef _WIN32
@ -446,6 +441,11 @@ typedef struct _ENetEvent
ENetPacket * packet; /**< packet associated with the event, if appropriate */ ENetPacket * packet; /**< packet associated with the event, if appropriate */
} ENetEvent; } ENetEvent;
#ifdef __cplusplus
extern "C"
{
#endif
/** @defgroup global ENet global functions /** @defgroup global ENet global functions
@{ @{
*/ */

View file

@ -20,6 +20,11 @@ typedef struct _ENetList
ENetListNode sentinel; ENetListNode sentinel;
} ENetList; } ENetList;
#ifdef __cplusplus
extern "C"
{
#endif
extern void enet_list_clear (ENetList *); extern void enet_list_clear (ENetList *);
extern ENetListIterator enet_list_insert (ENetListIterator, void *); 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 *); extern size_t enet_list_size (ENetList *);
#ifdef __cplusplus
}
#endif
#define enet_list_begin(list) ((list) -> sentinel.next) #define enet_list_begin(list) ((list) -> sentinel.next)
#define enet_list_end(list) (& (list) -> sentinel) #define enet_list_end(list) (& (list) -> sentinel)