Skip to content

Commit

Permalink
fix extern "C" usage
Browse files Browse the repository at this point in the history
  • Loading branch information
lsalzman committed Jun 26, 2024
1 parent 29260f7 commit 7083138
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 5 deletions.
10 changes: 10 additions & 0 deletions include/enet/callbacks.h
Original file line number Diff line number Diff line change
Expand Up @@ -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__ */

10 changes: 5 additions & 5 deletions include/enet/enet.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@
#ifndef __ENET_ENET_H__
#define __ENET_ENET_H__

#ifdef __cplusplus
extern "C"
{
#endif

#include <stdlib.h>

#ifdef _WIN32
Expand Down Expand Up @@ -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
@{
*/
Expand Down
9 changes: 9 additions & 0 deletions include/enet/list.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 *);
Expand All @@ -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)

Expand Down

0 comments on commit 7083138

Please sign in to comment.